ccRTP 2.1.2: iqueue.h Source File

ccRTP 2.1.2
iqueue.h
Go to the documentation of this file.
1 // Copyright (C) 2001-2015 Federico Montesino Pouzols <fedemp@altern.org>.
2 //
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public License
14 // along with GNU ccRTP. If not, see <http://www.gnu.org/licenses/>.
15 //
16 // As a special exception, you may use this file as part of a free software
17 // library without restriction. Specifically, if other files instantiate
18 // templates or use macros or inline functions from this file, or you compile
19 // this file and link it with other files to produce an executable, this
20 // file does not by itself cause the resulting executable to be covered by
21 // the GNU General Public License. This exception does not however
22 // invalidate any other reasons why the executable file might be covered by
23 // the GNU General Public License.
24 //
25 // This exception applies only to the code released under the name GNU
26 // ccRTP. If you copy code from other releases into a copy of GNU
27 // ccRTP, as the General Public License permits, the exception does
28 // not apply to the code that you add in this way. To avoid misleading
29 // anyone as to the status of such modified files, you must delete
30 // this exception notice from them.
31 //
32 // If you write modifications of your own for GNU ccRTP, it is your choice
33 // whether to permit this exception to apply to your modifications.
34 // If you do not wish that, delete this exception notice.
35 //
36 
43 #ifndef CCXX_RTP_IQUEUE_H_
44 #define CCXX_RTP_IQUEUE_H_
45 
46 #include <ccrtp/queuebase.h>
47 #include <ccrtp/CryptoContext.h>
48 
49 #include <list>
50 
51 NAMESPACE_COMMONCPP
52 
67  class __EXPORT Members
68 {
69 public:
70  inline void
71   setMembersCount(uint32 n)
72  { members = n; }
73 
74  inline void
75   increaseMembersCount()
76  { members++; }
77 
78  inline void
79   decreaseMembersCount()
80  { members--; }
81 
82  inline uint32
83   getMembersCount() const
84 { return members; }
85 
86  inline void
87   setSendersCount(uint32 n)
88  { activeSenders = n; }
89 
90  inline void
91   increaseSendersCount()
92  { activeSenders++; }
93 
94  inline void
95   decreaseSendersCount()
96  { activeSenders--; }
97 
98  inline uint32
99   getSendersCount() const
100 { return activeSenders; }
101 
102 protected:
103   Members() :
104  members(0),
105  activeSenders(0)
106  { }
107 
108   inline virtual ~Members()
109  { }
110 
111 private:
113   uint32 members;
115   uint32 activeSenders;
116 };
117 
124  class __EXPORT SyncSourceHandler
125 {
126 public:
133  inline void*
134   getLink(const SyncSource& source) const
135 { return source.getLink(); }
136 
137  inline void
138   setLink(SyncSource& source, void* link)
139  { source.setLink(link); }
140 
141  inline void
142   setParticipant(SyncSource& source, Participant& p)
143  { source.setParticipant(p); }
144 
145  inline void
146   setState(SyncSource& source, SyncSource::State ns)
147  { source.setState(ns); }
148 
149  inline void
150   setSender(SyncSource& source, bool active)
151  { source.setSender(active); }
152 
153  inline void
154   setDataTransportPort(SyncSource& source, tpport_t p)
155  { source.setDataTransportPort(p); }
156 
157  inline void
158   setControlTransportPort(SyncSource& source, tpport_t p)
159  { source.setControlTransportPort(p); }
160 
161  inline void
162   setNetworkAddress(SyncSource& source, InetAddress addr)
163  { source.setNetworkAddress(addr); }
164 
165 protected:
166   SyncSourceHandler()
167  { }
168 
169   inline virtual ~SyncSourceHandler()
170  { }
171 };
172 
179  class __EXPORT ParticipantHandler
180 {
181 public:
182  inline void
183   setSDESItem(Participant* part, SDESItemType item,
184  const std::string& val)
185  { part->setSDESItem(item,val); }
186 
187  inline void
188   setPRIVPrefix(Participant* part, const std::string val)
189  { part->setPRIVPrefix(val); }
190 
191 protected:
192   ParticipantHandler()
193  { }
194 
195   inline virtual ~ParticipantHandler()
196  { }
197 };
198 
205  class __EXPORT ApplicationHandler
206 {
207 public:
208  inline void
209   addParticipant(RTPApplication& app, Participant& part)
210  { app.addParticipant(part); }
211 
212  inline void
213   removeParticipant(RTPApplication& app,
214  RTPApplication::ParticipantLink* pl)
215  { app.removeParticipant(pl); }
216 
217 protected:
218   ApplicationHandler()
219  { }
220 
221   inline virtual ~ApplicationHandler()
222  { }
223 };
224 
232  class __EXPORT ConflictHandler
233 {
234 public:
235   struct ConflictingTransportAddress
236  {
237  ConflictingTransportAddress(InetAddress na,
238  tpport_t dtp, tpport_t ctp);
239 
240   void setNext(ConflictingTransportAddress* nc)
241  { next = nc; }
242 
243   inline const InetAddress& getNetworkAddress( ) const
244 { return networkAddress; }
245 
246   inline tpport_t getDataTransportPort() const
247 { return dataTransportPort; }
248 
249   inline tpport_t getControlTransportPort() const
250 { return controlTransportPort; }
251 
252   InetAddress networkAddress;
253   tpport_t dataTransportPort;
254   tpport_t controlTransportPort;
255   ConflictingTransportAddress* next;
256  // arrival time of last data or control packet.
257   timeval lastPacketTime;
258  };
259 
264  ConflictingTransportAddress* searchDataConflict(InetAddress na,
265  tpport_t dtp);
270  ConflictingTransportAddress* searchControlConflict(InetAddress na,
271  tpport_t ctp);
272 
273   void updateConflict(ConflictingTransportAddress& ca)
274  { SysTime::gettimeofday(&(ca.lastPacketTime),NULL); }
275 
276  void addConflict(const InetAddress& na, tpport_t dtp, tpport_t ctp);
277 
278 protected:
279   ConflictHandler()
280  { firstConflict = lastConflict = NULL; }
281 
282   inline virtual ~ConflictHandler()
283  { }
284 
285   ConflictingTransportAddress* firstConflict, * lastConflict;
286 };
287 
298  class __EXPORT MembershipBookkeeping :
299  public SyncSourceHandler,
300  public ParticipantHandler,
301  public ApplicationHandler,
302  public ConflictHandler,
303  private Members
304 {
305 public:
306   inline size_t getDefaultMembersHashSize()
307  { return defaultMembersHashSize; }
308 
309 protected:
310 
324  MembershipBookkeeping(uint32 initialSize = defaultMembersHashSize);
325 
330  inline virtual
331   ~MembershipBookkeeping()
332  { endMembers(); }
333 
334  struct SyncSourceLink;
335 
336   inline SyncSourceLink* getLink(const SyncSource& source) const
337 { return static_cast<SyncSourceLink*>(SyncSourceHandler::getLink(source)); }
342   inline bool isMine(const SyncSource& source) const
343 { return getLink(source)->getMembership() == this; }
344 
351   struct IncomingRTPPktLink
352  {
353   IncomingRTPPktLink(IncomingRTPPkt* pkt, SyncSourceLink* sLink,
354  struct timeval& recv_ts,
355  uint32 shifted_ts,
356  IncomingRTPPktLink* sp,
357  IncomingRTPPktLink* sn,
358  IncomingRTPPktLink* p,
359  IncomingRTPPktLink* n) :
360  packet(pkt),
361  sourceLink(sLink),
362  prev(p), next(n),
363  srcPrev(sp), srcNext(sn),
364  receptionTime(recv_ts),
365  shiftedTimestamp(shifted_ts)
366  { }
367 
368   ~IncomingRTPPktLink()
369  { }
370 
371   inline SyncSourceLink* getSourceLink() const
372 { return sourceLink; }
373 
374   inline void setSourceLink(SyncSourceLink* src)
375  { sourceLink = src; }
376 
377   inline IncomingRTPPktLink* getNext() const
378 { return next; }
379 
380   inline void setNext(IncomingRTPPktLink* nl)
381  { next = nl; }
382 
383   inline IncomingRTPPktLink* getPrev() const
384 { return prev; }
385 
386   inline void setPrev(IncomingRTPPktLink* pl)
387  { prev = pl; }
388 
389   inline IncomingRTPPktLink* getSrcNext() const
390 { return srcNext; }
391 
392   inline void setSrcNext(IncomingRTPPktLink* sn)
393  { srcNext = sn; }
394 
395   inline IncomingRTPPktLink* getSrcPrev() const
396 { return srcPrev; }
397 
398   inline void setSrcPrev(IncomingRTPPktLink* sp)
399  { srcPrev = sp; }
400 
401   inline IncomingRTPPkt* getPacket() const
402 { return packet; }
403 
404   inline void setPacket(IncomingRTPPkt* pkt)
405  { packet = pkt; }
406 
414   inline void setRecvTime(const timeval &t)
415  { receptionTime = t; }
416 
420   inline timeval getRecvTime() const
421 { return receptionTime; }
422 
431   inline uint32 getTimestamp() const
432 { return shiftedTimestamp; }
433 
434   inline void setTimestamp(uint32 ts)
435  { shiftedTimestamp = ts;}
436 
437  // the packet this link refers to.
438   IncomingRTPPkt* packet;
439  // the synchronization source this packet comes from.
440   SyncSourceLink* sourceLink;
441  // global incoming packet queue links.
442   IncomingRTPPktLink* prev, * next;
443  // source specific incoming packet queue links.
444   IncomingRTPPktLink* srcPrev, * srcNext;
445  // time this packet was received at
446   struct timeval receptionTime;
447  // timestamp of the packet in host order and after
448  // substracting the initial timestamp for its source
449  // (it is an increment from the initial timestamp).
450   uint32 shiftedTimestamp;
451  };
452 
469   struct SyncSourceLink
470  {
471  // 2^16
472   static const uint32 SEQNUMMOD;
473 
474   SyncSourceLink(MembershipBookkeeping* m,
475  SyncSource* s,
476  IncomingRTPPktLink* fp = NULL,
477  IncomingRTPPktLink* lp = NULL,
478  SyncSourceLink* ps = NULL,
479  SyncSourceLink* ns = NULL,
480  SyncSourceLink* ncollis = NULL) :
481  membership(m), source(s), first(fp), last(lp),
482  prev(ps), next(ns), nextCollis(ncollis),
483  prevConflict(NULL)
484  { m->setLink(*s,this); // record that the source is associated
485  initStats(); // to this link.
486  }
487 
491  ~SyncSourceLink();
492 
493   inline MembershipBookkeeping* getMembership()
494  { return membership; }
495 
500   inline SyncSource* getSource() { return source; }
501 
506   inline IncomingRTPPktLink* getFirst()
507  { return first; }
508 
509   inline void setFirst(IncomingRTPPktLink* fp)
510  { first = fp; }
511 
516   inline IncomingRTPPktLink* getLast()
517  { return last; }
518 
519   inline void setLast(IncomingRTPPktLink* lp)
520  { last = lp; }
521 
525   inline SyncSourceLink* getPrev()
526  { return prev; }
527 
528   inline void setPrev(SyncSourceLink* ps)
529  { prev = ps; }
530 
534   inline SyncSourceLink* getNext()
535  { return next; }
536 
537   inline void setNext(SyncSourceLink *ns)
538  { next = ns; }
539 
546   inline SyncSourceLink* getNextCollis()
547  { return nextCollis; }
548 
549   inline void setNextCollis(SyncSourceLink* ns)
550  { nextCollis = ns; }
551 
552   inline ConflictingTransportAddress* getPrevConflict() const
553 { return prevConflict; }
554 
558  void setPrevConflict(InetAddress& addr, tpport_t dataPort,
559  tpport_t controlPort);
560 
561   unsigned char* getSenderInfo()
562  { return senderInfo; }
563 
564  void setSenderInfo(unsigned char* si);
565 
566   unsigned char* getReceiverInfo()
567  { return receiverInfo; }
568 
569  void setReceiverInfo(unsigned char* ri);
570 
571   inline timeval getLastPacketTime() const
572 { return lastPacketTime; }
573 
574   inline timeval getLastRTCPPacketTime() const
575 { return lastRTCPPacketTime; }
576 
577   inline timeval getLastRTCPSRTime() const
578 { return lastRTCPSRTime; }
579 
584   inline uint32 getObservedPacketCount() const
585 { return obsPacketCount; }
586 
587   inline void incObservedPacketCount()
588  { obsPacketCount++; }
589 
594   inline uint32 getObservedOctetCount() const
595 { return obsOctetCount; }
596 
597   inline void incObservedOctetCount(uint32 n)
598  { obsOctetCount += n; }
599 
603  uint16
604   getMaxSeqNum() const
605 { return maxSeqNum; }
606 
611  void
612   setMaxSeqNum(uint16 max)
613  { maxSeqNum = max; }
614 
615  inline uint32
616   getExtendedMaxSeqNum() const
617 { return extendedMaxSeqNum; }
618 
619  inline void
620   setExtendedMaxSeqNum(uint32 seq)
621  { extendedMaxSeqNum = seq; }
622 
623   inline uint32 getCumulativePacketLost() const
624 { return cumulativePacketLost; }
625 
626   inline void setCumulativePacketLost(uint32 pl)
627  { cumulativePacketLost = pl; }
628 
629   inline uint8 getFractionLost() const
630 { return fractionLost; }
631 
632   inline void setFractionLost(uint8 fl)
633  { fractionLost = fl; }
634 
635   inline uint32 getLastPacketTransitTime()
636  { return lastPacketTransitTime; }
637 
638   inline void setLastPacketTransitTime(uint32 time)
639  { lastPacketTransitTime = time; }
640 
641   inline float getJitter() const
642 { return jitter; }
643 
644   inline void setJitter(float j)
645  { jitter = j; }
646 
647   inline uint32 getInitialDataTimestamp() const
648 { return initialDataTimestamp; }
649 
650   inline void setInitialDataTimestamp(uint32 ts)
651  { initialDataTimestamp = ts; }
652 
653   inline timeval getInitialDataTime() const
654 { return initialDataTime; }
655 
656   inline void setInitialDataTime(timeval it)
657  { initialDataTime = it; }
658 
666   bool getGoodbye()
667  {
668  if(!flag)
669  return false;
670  flag = false;
671  return true;
672  }
673 
680   bool getHello() {
681  if(flag)
682  return false;
683  flag = true;
684  return true;
685  }
686 
687   inline uint32 getBadSeqNum() const
688 { return badSeqNum; }
689 
690   inline void setBadSeqNum(uint32 seq)
691  { badSeqNum = seq; }
692 
693   uint8 getProbation() const
694 { return probation; }
695 
696   inline void setProbation(uint8 p)
697  { probation = p; }
698 
699   inline void decProbation()
700  { --probation; }
701 
702   bool isValid() const
703 { return 0 == probation; }
704 
705   inline uint16 getBaseSeqNum() const
706 { return baseSeqNum; }
707 
708   inline void setBaseSeqNum(uint16 seqnum)
709  { baseSeqNum = seqnum; }
710 
711   inline uint32 getSeqNumAccum() const
712 { return seqNumAccum; }
713 
714   inline void incSeqNumAccum()
715  { seqNumAccum += SEQNUMMOD; }
716 
720   inline void initSequence(uint16 seqnum)
721  { maxSeqNum = seqNumAccum = seqnum; }
722 
733  void recordInsertion(const IncomingRTPPktLink& pl);
734 
735  void initStats();
736 
741  void computeStats();
742 
743   MembershipBookkeeping* membership;
744  // The source this link object refers to.
745   SyncSource* source;
746  // first/last packets from this source in the queue.
747   IncomingRTPPktLink* first, * last;
748  // Links for synchronization sources located before
749  // and after this one in the list of sources.
750   SyncSourceLink* prev, * next;
751  // Prev and next inside the hash table collision list.
752   SyncSourceLink* nextCollis;
753   ConflictingTransportAddress* prevConflict;
754   unsigned char* senderInfo;
755   unsigned char* receiverInfo;
756  // time the last RTP packet from this source was
757  // received at.
758   timeval lastPacketTime;
759  // time the last RTCP packet was received.
760   timeval lastRTCPPacketTime;
761  // time the lasrt RTCP SR was received. Required for
762  // DLSR computation.
763   timeval lastRTCPSRTime;
764 
765  // for outgoing RR reports.
766  // number of packets received from this source.
767   uint32 obsPacketCount;
768  // number of octets received from this source.
769   uint32 obsOctetCount;
770  // the higher sequence number seen from this source
771   uint16 maxSeqNum;
772   uint32 extendedMaxSeqNum;
773   uint32 cumulativePacketLost;
774   uint8 fractionLost;
775  // for interarrivel jitter computation
776   uint32 lastPacketTransitTime;
777  // interarrival jitter of packets from this source.
778   float jitter;
779   uint32 initialDataTimestamp;
780   timeval initialDataTime;
781 
782  // this flag assures we only call one gotHello and one
783  // gotGoodbye for this src.
784   bool flag;
785 
786  // for source validation:
787   uint32 badSeqNum;
788   uint8 probation; // packets in sequence before valid.
789   uint16 baseSeqNum;
790   uint32 expectedPrior;
791   uint32 receivedPrior;
792   uint32 seqNumAccum;
793  };
794 
799  bool
800  isRegistered(uint32 ssrc);
801 
810  SyncSourceLink*
811  getSourceBySSRC(uint32 ssrc, bool& created);
812 
823  bool
824  BYESource(uint32 ssrc);
825 
833  bool
834  removeSource(uint32 ssrc);
835 
836   inline SyncSourceLink* getFirst()
837  { return first; }
838 
839   inline SyncSourceLink* getLast()
840  { return last; }
841 
842  inline uint32
843   getMembersCount()
844  { return Members::getMembersCount(); }
845 
846  inline void
847   setMembersCount(uint32 n)
848  { Members::setMembersCount(n); }
849 
850  inline uint32
851   getSendersCount()
852  { return Members::getSendersCount(); }
853 
854   static const size_t defaultMembersHashSize;
855   static const uint32 SEQNUMMOD;
856 
857 private:
858  MembershipBookkeeping(const MembershipBookkeeping &o);
859 
860  MembershipBookkeeping&
861  operator=(const MembershipBookkeeping &o);
862 
867  void
868  endMembers();
869 
870  // Hash table with sources of RTP and RTCP packets
871   uint32 sourceBucketsNum;
872   SyncSourceLink** sourceLinks;
873  // List of sources, ordered from older to newer
874   SyncSourceLink* first, * last;
875 };
876 
883  class __EXPORT IncomingDataQueue: public IncomingDataQueueBase,
884  protected MembershipBookkeeping
885 {
886 public:
892   class SyncSourcesIterator
893  {
894  public:
895   typedef std::forward_iterator_tag iterator_category;
896   typedef SyncSource value_type;
897   typedef std::ptrdiff_t difference_type;
898   typedef const SyncSource* pointer;
899   typedef const SyncSource& reference;
900 
901   SyncSourcesIterator(SyncSourceLink* l = NULL) :
902  link(l)
903  { }
904 
905   SyncSourcesIterator(const SyncSourcesIterator& si) :
906  link(si.link)
907  { }
908 
909   reference operator*() const
910 { return *(link->getSource()); }
911 
912   pointer operator->() const
913 { return link->getSource(); }
914 
915   SyncSourcesIterator& operator++() {
916  link = link->getNext();
917  return *this;
918  }
919 
920   SyncSourcesIterator operator++(int) {
921  SyncSourcesIterator result(*this);
922  ++(*this);
923  return result;
924  }
925 
926   friend bool operator==(const SyncSourcesIterator& l,
927  const SyncSourcesIterator& r)
928  { return l.link == r.link; }
929 
930   friend bool operator!=(const SyncSourcesIterator& l,
931  const SyncSourcesIterator& r)
932  { return l.link != r.link; }
933 
934  private:
935   SyncSourceLink *link;
936  };
937 
938   SyncSourcesIterator begin()
939  { return SyncSourcesIterator(MembershipBookkeeping::getFirst()); }
940 
941   SyncSourcesIterator end()
942  { return SyncSourcesIterator(NULL); }
943 
953  const AppDataUnit*
954  getData(uint32 stamp, const SyncSource* src = NULL);
955 
956 
963  bool
964  isWaiting(const SyncSource* src = NULL) const;
965 
972  uint32
973  getFirstTimestamp(const SyncSource* src = NULL) const;
974 
997  void
998   setMinValidPacketSequence(uint8 packets)
999  { minValidPacketSequence = packets; }
1000 
1001  uint8
1002   getDefaultMinValidPacketSequence() const
1003 { return defaultMinValidPacketSequence; }
1004 
1009  uint8
1010   getMinValidPacketSequence() const
1011 { return minValidPacketSequence; }
1012 
1013  void
1014   setMaxPacketMisorder(uint16 packets)
1015  { maxPacketMisorder = packets; }
1016 
1017  uint16
1018   getDefaultMaxPacketMisorder() const
1019 { return defaultMaxPacketMisorder; }
1020 
1021  uint16
1022   getMaxPacketMisorder() const
1023 { return maxPacketMisorder; }
1024 
1030  void
1031   setMaxPacketDropout(uint16 packets) // default: 3000.
1032  { maxPacketDropout = packets; }
1033 
1034  uint16
1035   getDefaultMaxPacketDropout() const
1036 { return defaultMaxPacketDropout; }
1037 
1038  uint16
1039   getMaxPacketDropout() const
1040 { return maxPacketDropout; }
1041 
1042  // default value for constructors that allow to specify
1043  // members table s\ize
1044  inline static size_t
1045   getDefaultMembersSize()
1046  { return defaultMembersSize; }
1047 
1056  void
1057  setInQueueCryptoContext(CryptoContext* cc);
1058 
1069  void
1070  removeInQueueCryptoContext(CryptoContext* cc);
1071 
1079  CryptoContext*
1080  getInQueueCryptoContext(uint32 ssrc);
1081 
1082 protected:
1086  IncomingDataQueue(uint32 size);
1087 
1088   virtual ~IncomingDataQueue()
1089  { }
1090 
1103  bool checkSSRCInIncomingRTPPkt(SyncSourceLink& sourceLink,
1104  bool is_new, InetAddress& na,
1105  tpport_t tp);
1106 
1122   void setSourceExpirationPeriod(uint8 intervals)
1123  { sourceExpirationPeriod = intervals; }
1124 
1131  virtual size_t
1132  takeInDataPacket();
1133 
1134  void renewLocalSSRC();
1135 
1145  IncomingDataQueue::IncomingRTPPktLink*
1146  getWaiting(uint32 timestamp, const SyncSource *src = NULL);
1147 
1163  bool
1164  recordReception(SyncSourceLink& srcLink, const IncomingRTPPkt& pkt,
1165  const timeval recvtime);
1166 
1173  void
1174  recordExtraction(const IncomingRTPPkt& pkt);
1175 
1176  void purgeIncomingQueue();
1177 
1184  inline virtual void
1185   onNewSyncSource(const SyncSource&)
1186  { }
1187 
1188 protected:
1205  inline virtual bool
1206   onRTPPacketRecv(IncomingRTPPkt&)
1207  { return true; }
1208 
1217   inline virtual void onExpireRecv(IncomingRTPPkt&)
1218  { return; }
1219 
1233  inline virtual bool
1234   onSRTPPacketError(IncomingRTPPkt& pkt, int32 errorCode)
1235  { return false; }
1236 
1237  inline virtual bool
1238   end2EndDelayed(IncomingRTPPktLink&)
1239  { return false; }
1240 
1256  bool
1257  insertRecvPacket(IncomingRTPPktLink* packetLink);
1258 
1270  virtual size_t
1271  recvData(unsigned char* buffer, size_t length,
1272  InetHostAddress& host, tpport_t& port) = 0;
1273 
1274  virtual size_t
1275  getNextDataPacketSize() const = 0;
1276 
1277   mutable ThreadLock recvLock;
1278  // reception queue
1279   IncomingRTPPktLink* recvFirst, * recvLast;
1280  // values for packet validation.
1281   static const uint8 defaultMinValidPacketSequence;
1282   static const uint16 defaultMaxPacketMisorder;
1283   static const uint16 defaultMaxPacketDropout;
1284   uint8 minValidPacketSequence;
1285   uint16 maxPacketMisorder;
1286   uint16 maxPacketDropout;
1287   static const size_t defaultMembersSize;
1288   uint8 sourceExpirationPeriod;
1289   mutable Mutex cryptoMutex;
1290   std::list<CryptoContext *> cryptoContexts;
1291 };
1292  // iqueue
1294 
1295 END_NAMESPACE
1296 
1297 #endif //CCXX_RTP_IQUEUE_H_
1298 
IncomingDataQueue::onRTPPacketRecv
virtual bool onRTPPacketRecv(IncomingRTPPkt &)
A virtual function to support parsing of arriving packets to determine if they should be kept in the ...
Definition: iqueue.h:1206
ConflictHandler::ConflictingTransportAddress::next
ConflictingTransportAddress * next
Definition: iqueue.h:255
IncomingDataQueue::defaultMaxPacketDropout
static const uint16 defaultMaxPacketDropout
Definition: iqueue.h:1283
ApplicationHandler::addParticipant
void addParticipant(RTPApplication &app, Participant &part)
Definition: iqueue.h:209
MembershipBookkeeping::SEQNUMMOD
static const uint32 SEQNUMMOD
Definition: iqueue.h:855
ParticipantHandler::~ParticipantHandler
virtual ~ParticipantHandler()
Definition: iqueue.h:195
IncomingDataQueue::setSourceExpirationPeriod
void setSourceExpirationPeriod(uint8 intervals)
Set the number of RTCP intervals that the stack will wait to change the state of a source from stateA...
Definition: iqueue.h:1122
IncomingDataQueue::cryptoMutex
Mutex cryptoMutex
Definition: iqueue.h:1289
RTPApplication
An RTP application, holding identifying RTCP SDES item values.
Definition: sources.h:364
Members::setMembersCount
void setMembersCount(uint32 n)
Definition: iqueue.h:71
IncomingDataQueue::SyncSourcesIterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: iqueue.h:895
SyncSource
Synchronization source in an RTP session.
Definition: sources.h:192
MembershipBookkeeping::~MembershipBookkeeping
virtual ~MembershipBookkeeping()
Purges all RTPSource structures created during the session, as well as the hash table and the list of...
Definition: iqueue.h:331
SyncSource::setParticipant
void setParticipant(Participant &p)
Definition: sources.h:304
ParticipantHandler::setPRIVPrefix
void setPRIVPrefix(Participant *part, const std::string val)
Definition: iqueue.h:188
IncomingDataQueue::recvLock
ThreadLock recvLock
Definition: iqueue.h:1277
AppDataUnit
Interface (envelope) to data received over RTP packets.
Definition: queuebase.h:68
CryptoContext
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:82
IncomingDataQueue::setMinValidPacketSequence
void setMinValidPacketSequence(uint8 packets)
When receiving packets from a new source, it may be convenient to reject a first few packets before w...
Definition: iqueue.h:998
SyncSource::setControlTransportPort
void setControlTransportPort(tpport_t p)
Definition: sources.h:310
SyncSourceHandler::setSender
void setSender(SyncSource &source, bool active)
Definition: iqueue.h:150
ApplicationHandler::removeParticipant
void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl)
Definition: iqueue.h:213
IncomingDataQueue::SyncSourcesIterator::pointer
const SyncSource * pointer
Definition: iqueue.h:898
MembershipBookkeeping::getMembersCount
uint32 getMembersCount()
Definition: iqueue.h:843
IncomingDataQueue::maxPacketMisorder
uint16 maxPacketMisorder
Definition: iqueue.h:1285
IncomingRTPPkt
RTP packets received from other participants.
Definition: rtppkt.h:704
MembershipBookkeeping::getSendersCount
uint32 getSendersCount()
Definition: iqueue.h:851
IncomingDataQueue::defaultMembersSize
static const size_t defaultMembersSize
Definition: iqueue.h:1287
SyncSourceHandler::setState
void setState(SyncSource &source, SyncSource::State ns)
Definition: iqueue.h:146
IncomingDataQueue::end2EndDelayed
virtual bool end2EndDelayed(IncomingRTPPktLink &)
Definition: iqueue.h:1238
IncomingDataQueue::SyncSourcesIterator::operator++
SyncSourcesIterator operator++(int)
Definition: iqueue.h:920
IncomingDataQueue::maxPacketDropout
uint16 maxPacketDropout
Definition: iqueue.h:1286
IncomingDataQueue::getDefaultMembersSize
static size_t getDefaultMembersSize()
Definition: iqueue.h:1045
IncomingDataQueue::SyncSourcesIterator::reference
const SyncSource & reference
Definition: iqueue.h:899
IncomingDataQueue::onNewSyncSource
virtual void onNewSyncSource(const SyncSource &)
Virtual called when a new synchronization source has joined the session.
Definition: iqueue.h:1185
IncomingDataQueue
Queue for incoming RTP data packets in an RTP session.
Definition: iqueue.h:883
IncomingDataQueue::minValidPacketSequence
uint8 minValidPacketSequence
Definition: iqueue.h:1284
RTPQueueBase::renewLocalSSRC
virtual void renewLocalSSRC()
Definition: queuebase.h:232
Members::increaseMembersCount
void increaseMembersCount()
Definition: iqueue.h:75
IncomingDataQueue::getMinValidPacketSequence
uint8 getMinValidPacketSequence() const
Get the minimun number of consecutive packets that must be received from a source before accepting it...
Definition: iqueue.h:1010
IncomingDataQueue::setMaxPacketMisorder
void setMaxPacketMisorder(uint16 packets)
Definition: iqueue.h:1014
ParticipantHandler
Participant objects modification methods.
Definition: iqueue.h:179
SyncSource::setState
void setState(State st)
Definition: sources.h:293
IncomingDataQueue::getMaxPacketMisorder
uint16 getMaxPacketMisorder() const
Definition: iqueue.h:1022
Members::increaseSendersCount
void increaseSendersCount()
Definition: iqueue.h:91
MembershipBookkeeping::sourceLinks
SyncSourceLink ** sourceLinks
Definition: iqueue.h:872
IncomingDataQueue::defaultMaxPacketMisorder
static const uint16 defaultMaxPacketMisorder
Definition: iqueue.h:1282
IncomingDataQueue::getDefaultMaxPacketMisorder
uint16 getDefaultMaxPacketMisorder() const
Definition: iqueue.h:1018
IncomingDataQueue::SyncSourcesIterator::operator*
reference operator*() const
Definition: iqueue.h:909
Members
members and senders accounting
Definition: iqueue.h:67
Members::getMembersCount
uint32 getMembersCount() const
Definition: iqueue.h:83
SyncSourceHandler::getLink
void * getLink(const SyncSource &source) const
This requires SyncSource - SyncSourceHandler friendship.
Definition: iqueue.h:134
ConflictHandler
To track addresses of sources conflicting with the local one.
Definition: iqueue.h:232
SyncSource::State
State
Synchronization source states during an RTP session.
Definition: sources.h:225
ApplicationHandler
Application objects modification methods.
Definition: iqueue.h:205
Participant
A class of objects representing remote participants (RTP applications) in a multimedia session...
Definition: sources.h:124
IncomingDataQueue::sourceExpirationPeriod
uint8 sourceExpirationPeriod
Definition: iqueue.h:1288
ConflictHandler::ConflictingTransportAddress::setNext
void setNext(ConflictingTransportAddress *nc)
Definition: iqueue.h:240
MembershipBookkeeping::getDefaultMembersHashSize
size_t getDefaultMembersHashSize()
Definition: iqueue.h:306
Members::getSendersCount
uint32 getSendersCount() const
Definition: iqueue.h:99
SyncSourceHandler::setNetworkAddress
void setNetworkAddress(SyncSource &source, InetAddress addr)
Definition: iqueue.h:162
MembershipBookkeeping::last
SyncSourceLink * last
Definition: iqueue.h:874
IncomingDataQueue::SyncSourcesIterator::operator++
SyncSourcesIterator & operator++()
Definition: iqueue.h:915
queuebase.h
Base classes for RTP queues.
MembershipBookkeeping::isMine
bool isMine(const SyncSource &source) const
Get whether a synchronization source is recorded in this membership controller.
Definition: iqueue.h:342
ParticipantHandler::setSDESItem
void setSDESItem(Participant *part, SDESItemType item, const std::string &val)
Definition: iqueue.h:183
MembershipBookkeeping::defaultMembersHashSize
static const size_t defaultMembersHashSize
Definition: iqueue.h:854
SyncSourceHandler::setParticipant
void setParticipant(SyncSource &source, Participant &p)
Definition: iqueue.h:142
SyncSourceHandler::setDataTransportPort
void setDataTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:154
__EXPORT
#define __EXPORT
Definition: ZrtpCallback.h:40
SyncSource::setLink
void setLink(void *l)
Definition: sources.h:317
ApplicationHandler::ApplicationHandler
ApplicationHandler()
Definition: iqueue.h:218
MembershipBookkeeping::getLast
SyncSourceLink * getLast()
Definition: iqueue.h:839
RTPApplication::addParticipant
void addParticipant(Participant &part)
Definition: source.cpp:189
RTPApplication::removeParticipant
void removeParticipant(ParticipantLink *part)
Definition: source.cpp:200
SyncSource::setSender
void setSender(bool active)
Mark this source as an active sender.
Definition: sources.h:300
ConflictHandler::ConflictingTransportAddress::getNetworkAddress
const InetAddress & getNetworkAddress() const
Definition: iqueue.h:243
ApplicationHandler::~ApplicationHandler
virtual ~ApplicationHandler()
Definition: iqueue.h:221
IncomingDataQueue::defaultMinValidPacketSequence
static const uint8 defaultMinValidPacketSequence
Definition: iqueue.h:1281
MembershipBookkeeping::setMembersCount
void setMembersCount(uint32 n)
Definition: iqueue.h:847
ConflictHandler::ConflictHandler
ConflictHandler()
Definition: iqueue.h:279
IncomingDataQueue::~IncomingDataQueue
virtual ~IncomingDataQueue()
Definition: iqueue.h:1088
IncomingDataQueue::getMaxPacketDropout
uint16 getMaxPacketDropout() const
Definition: iqueue.h:1039
SyncSource::getLink
void * getLink() const
Definition: sources.h:320
IncomingDataQueue::getDefaultMaxPacketDropout
uint16 getDefaultMaxPacketDropout() const
Definition: iqueue.h:1035
IncomingDataQueue::SyncSourcesIterator::operator!=
friend bool operator!=(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:930
MembershipBookkeeping
Controls the group membership in the current session.
Definition: iqueue.h:298
IncomingDataQueue::recvLast
IncomingRTPPktLink * recvLast
Definition: iqueue.h:1279
ConflictHandler::~ConflictHandler
virtual ~ConflictHandler()
Definition: iqueue.h:282
MembershipBookkeeping::getFirst
SyncSourceLink * getFirst()
Definition: iqueue.h:836
IncomingDataQueue::begin
SyncSourcesIterator begin()
Definition: iqueue.h:938
IncomingDataQueue::SyncSourcesIterator::SyncSourcesIterator
SyncSourcesIterator(SyncSourceLink *l=NULL)
Definition: iqueue.h:901
ConflictHandler::lastConflict
ConflictingTransportAddress * lastConflict
Definition: iqueue.h:285
ParticipantHandler::ParticipantHandler
ParticipantHandler()
Definition: iqueue.h:192
IncomingDataQueue::onExpireRecv
virtual void onExpireRecv(IncomingRTPPkt &)
A hook to filter packets in the receive queue that are being expired.
Definition: iqueue.h:1217
Members::decreaseSendersCount
void decreaseSendersCount()
Definition: iqueue.h:95
Members::decreaseMembersCount
void decreaseMembersCount()
Definition: iqueue.h:79
SyncSourceHandler::setLink
void setLink(SyncSource &source, void *link)
Definition: iqueue.h:138
Members::setSendersCount
void setSendersCount(uint32 n)
Definition: iqueue.h:87
IncomingDataQueue::SyncSourcesIterator::SyncSourcesIterator
SyncSourcesIterator(const SyncSourcesIterator &si)
Definition: iqueue.h:905
SyncSource::setDataTransportPort
void setDataTransportPort(tpport_t p)
Definition: sources.h:307
SyncSourceHandler::SyncSourceHandler
SyncSourceHandler()
Definition: iqueue.h:166
MembershipBookkeeping::getLink
SyncSourceLink * getLink(const SyncSource &source) const
Definition: iqueue.h:336
IncomingDataQueue::onSRTPPacketError
virtual bool onSRTPPacketError(IncomingRTPPkt &pkt, int32 errorCode)
A hook that gets called if the decoding of an incoming SRTP was erroneous.
Definition: iqueue.h:1234
SyncSourceHandler
SyncSource objects modification methods.
Definition: iqueue.h:124
IncomingDataQueue::end
SyncSourcesIterator end()
Definition: iqueue.h:941
ConflictHandler::updateConflict
void updateConflict(ConflictingTransportAddress &ca)
Definition: iqueue.h:273
IncomingDataQueue::setMaxPacketDropout
void setMaxPacketDropout(uint16 packets)
It also prevents packets sent after a restart of the source being immediately accepted.
Definition: iqueue.h:1031
IncomingDataQueue::getDefaultMinValidPacketSequence
uint8 getDefaultMinValidPacketSequence() const
Definition: iqueue.h:1002
IncomingDataQueue::SyncSourcesIterator::operator==
friend bool operator==(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:926
ConflictHandler::ConflictingTransportAddress::getDataTransportPort
tpport_t getDataTransportPort() const
Definition: iqueue.h:246
Participant::setPRIVPrefix
void setPRIVPrefix(const std::string val)
Set prefix value for the PRIV SDES item.
Definition: sources.h:177
SyncSourceHandler::~SyncSourceHandler
virtual ~SyncSourceHandler()
Definition: iqueue.h:169
IncomingDataQueue::cryptoContexts
std::list< CryptoContext * > cryptoContexts
Definition: iqueue.h:1290
MembershipBookkeeping::sourceBucketsNum
uint32 sourceBucketsNum
Definition: iqueue.h:871
SDESItemType
SDESItemType
SDES items that may be carried in a Source DEScription RTCP packet.
Definition: rtcppkt.h:64
ConflictHandler::ConflictingTransportAddress::getControlTransportPort
tpport_t getControlTransportPort() const
Definition: iqueue.h:249
Participant::setSDESItem
void setSDESItem(SDESItemType item, const std::string &val)
Set the value of a SDES item.
Definition: sources.h:170
Members::members
uint32 members
number of identified members
Definition: iqueue.h:113
Members::activeSenders
uint32 activeSenders
number of identified members that currently are active senders
Definition: iqueue.h:115
Members::Members
Members()
Definition: iqueue.h:103
Members::~Members
virtual ~Members()
Definition: iqueue.h:108
SyncSourceHandler::setControlTransportPort
void setControlTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:158
IncomingDataQueue::SyncSourcesIterator
iterator through the list of synchronizations sources in this session
Definition: iqueue.h:892
SyncSource::setNetworkAddress
void setNetworkAddress(InetAddress addr)
Definition: sources.h:313

Generated on Dec 15, 2017 for ccrtp-2.1.2 (*.h and *.cpp) and libzrtpcpp-2.3.4 (*.h), by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /