Bayonne2 / Common C++ 2 Framework: iqueue.h Source File

Bayonne2 / Common C++ 2 Framework
iqueue.h
Go to the documentation of this file.
1 // Copyright (C) 2001,2002,2004 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 General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 //
17 // As a special exception, you may use this file as part of a free software
18 // library without restriction. Specifically, if other files instantiate
19 // templates or use macros or inline functions from this file, or you compile
20 // this file and link it with other files to produce an executable, this
21 // file does not by itself cause the resulting executable to be covered by
22 // the GNU General Public License. This exception does not however
23 // invalidate any other reasons why the executable file might be covered by
24 // the GNU General Public License.
25 //
26 // This exception applies only to the code released under the name GNU
27 // ccRTP. If you copy code from other releases into a copy of GNU
28 // ccRTP, as the General Public License permits, the exception does
29 // not apply to the code that you add in this way. To avoid misleading
30 // anyone as to the status of such modified files, you must delete
31 // this exception notice from them.
32 //
33 // If you write modifications of your own for GNU ccRTP, it is your choice
34 // whether to permit this exception to apply to your modifications.
35 // If you do not wish that, delete this exception notice.
36 //
37 
44 #ifndef CCXX_RTP_IQUEUE_H_
45 #define CCXX_RTP_IQUEUE_H_
46 
47 #include <ccrtp/queuebase.h>
48 #include <ccrtp/CryptoContext.h>
49 
50 #include <list>
51 
52 #ifdef CCXX_NAMESPACES
53 namespace ost {
54 #endif
55 
70  class __EXPORT Members
71 {
72 public:
73  inline void
74   setMembersCount(uint32 n)
75  { members = n; }
76 
77  inline void
78   increaseMembersCount()
79  { members++; }
80 
81  inline void
82   decreaseMembersCount()
83  { members--; }
84 
85  inline uint32
86   getMembersCount() const
87 { return members; }
88 
89  inline void
90   setSendersCount(uint32 n)
91  { activeSenders = n; }
92 
93  inline void
94   increaseSendersCount()
95  { activeSenders++; }
96 
97  inline void
98   decreaseSendersCount()
99  { activeSenders--; }
100 
101  inline uint32
102   getSendersCount() const
103 { return activeSenders; }
104 
105 protected:
106   Members() :
107  members(0),
108  activeSenders(0)
109  { }
110 
111   inline virtual ~Members()
112  { }
113 
114 private:
116   uint32 members;
118   uint32 activeSenders;
119 };
120 
127  class __EXPORT SyncSourceHandler
128 {
129 public:
136  inline void*
137   getLink(const SyncSource& source) const
138 { return source.getLink(); }
139 
140  inline void
141   setLink(SyncSource& source, void* link)
142  { source.setLink(link); }
143 
144  inline void
145   setParticipant(SyncSource& source, Participant& p)
146  { source.setParticipant(p); }
147 
148  inline void
149   setState(SyncSource& source, SyncSource::State ns)
150  { source.setState(ns); }
151 
152  inline void
153   setSender(SyncSource& source, bool active)
154  { source.setSender(active); }
155 
156  inline void
157   setDataTransportPort(SyncSource& source, tpport_t p)
158  { source.setDataTransportPort(p); }
159 
160  inline void
161   setControlTransportPort(SyncSource& source, tpport_t p)
162  { source.setControlTransportPort(p); }
163 
164  inline void
165   setNetworkAddress(SyncSource& source, InetAddress addr)
166  { source.setNetworkAddress(addr); }
167 
168 protected:
169   SyncSourceHandler()
170  { }
171 
172   inline virtual ~SyncSourceHandler()
173  { }
174 };
175 
182  class __EXPORT ParticipantHandler
183 {
184 public:
185  inline void
186   setSDESItem(Participant* part, SDESItemType item,
187  const std::string& val)
188  { part->setSDESItem(item,val); }
189 
190  inline void
191   setPRIVPrefix(Participant* part, const std::string val)
192  { part->setPRIVPrefix(val); }
193 
194 protected:
195   ParticipantHandler()
196  { }
197 
198   inline virtual ~ParticipantHandler()
199  { }
200 };
201 
208  class __EXPORT ApplicationHandler
209 {
210 public:
211  inline void
212   addParticipant(RTPApplication& app, Participant& part)
213  { app.addParticipant(part); }
214 
215  inline void
216   removeParticipant(RTPApplication& app,
217  RTPApplication::ParticipantLink* pl)
218  { app.removeParticipant(pl); }
219 
220 protected:
221   ApplicationHandler()
222  { }
223 
224   inline virtual ~ApplicationHandler()
225  { }
226 };
227 
235  class __EXPORT ConflictHandler
236 {
237 public:
238   struct ConflictingTransportAddress
239  {
240  ConflictingTransportAddress(InetAddress na,
241  tpport_t dtp, tpport_t ctp);
242 
243   void setNext(ConflictingTransportAddress* nc)
244  { next = nc; }
245 
246   inline const InetAddress& getNetworkAddress( ) const
247 { return networkAddress; }
248 
249   inline tpport_t getDataTransportPort() const
250 { return dataTransportPort; }
251 
252   inline tpport_t getControlTransportPort() const
253 { return controlTransportPort; }
254 
255   InetAddress networkAddress;
256   tpport_t dataTransportPort;
257   tpport_t controlTransportPort;
258   ConflictingTransportAddress* next;
259  // arrival time of last data or control packet.
260   timeval lastPacketTime;
261  };
262 
267  ConflictingTransportAddress* searchDataConflict(InetAddress na,
268  tpport_t dtp);
273  ConflictingTransportAddress* searchControlConflict(InetAddress na,
274  tpport_t ctp);
275 
276   void updateConflict(ConflictingTransportAddress& ca)
277  { gettimeofday(&(ca.lastPacketTime),NULL); }
278 
279  void addConflict(const InetAddress& na, tpport_t dtp, tpport_t ctp);
280 
281 protected:
282   ConflictHandler()
283  { firstConflict = lastConflict = NULL; }
284 
285   inline virtual ~ConflictHandler()
286  { }
287 
288   ConflictingTransportAddress* firstConflict, * lastConflict;
289 };
290 
301  class __EXPORT MembershipBookkeeping :
302  public SyncSourceHandler,
303  public ParticipantHandler,
304  public ApplicationHandler,
305  public ConflictHandler,
306  private Members
307 {
308 public:
309   inline size_t getDefaultMembersHashSize()
310  { return defaultMembersHashSize; }
311 
312 protected:
313 
327  MembershipBookkeeping(uint32 initialSize = defaultMembersHashSize);
328 
333  inline virtual
334   ~MembershipBookkeeping()
335  { endMembers(); }
336 
337  struct SyncSourceLink;
338 
339   inline SyncSourceLink* getLink(const SyncSource& source) const
340 { return static_cast<SyncSourceLink*>(SyncSourceHandler::getLink(source)); }
345   inline bool isMine(const SyncSource& source) const
346 { return getLink(source)->getMembership() == this; }
347 
354   struct IncomingRTPPktLink
355  {
356   IncomingRTPPktLink(IncomingRTPPkt* pkt, SyncSourceLink* sLink,
357  struct timeval& recv_ts,
358  uint32 shifted_ts,
359  IncomingRTPPktLink* sp,
360  IncomingRTPPktLink* sn,
361  IncomingRTPPktLink* p,
362  IncomingRTPPktLink* n) :
363  packet(pkt),
364  sourceLink(sLink),
365  prev(p), next(n),
366  srcPrev(sp), srcNext(sn),
367  receptionTime(recv_ts),
368  shiftedTimestamp(shifted_ts)
369  { }
370 
371   ~IncomingRTPPktLink()
372  { }
373 
374   inline SyncSourceLink* getSourceLink() const
375 { return sourceLink; }
376 
377   inline void setSourceLink(SyncSourceLink* src)
378  { sourceLink = src; }
379 
380   inline IncomingRTPPktLink* getNext() const
381 { return next; }
382 
383   inline void setNext(IncomingRTPPktLink* nl)
384  { next = nl; }
385 
386   inline IncomingRTPPktLink* getPrev() const
387 { return prev; }
388 
389   inline void setPrev(IncomingRTPPktLink* pl)
390  { prev = pl; }
391 
392   inline IncomingRTPPktLink* getSrcNext() const
393 { return srcNext; }
394 
395   inline void setSrcNext(IncomingRTPPktLink* sn)
396  { srcNext = sn; }
397 
398   inline IncomingRTPPktLink* getSrcPrev() const
399 { return srcPrev; }
400 
401   inline void setSrcPrev(IncomingRTPPktLink* sp)
402  { srcPrev = sp; }
403 
404   inline IncomingRTPPkt* getPacket() const
405 { return packet; }
406 
407   inline void setPacket(IncomingRTPPkt* pkt)
408  { packet = pkt; }
409 
417   inline void setRecvTime(const timeval &t)
418  { receptionTime = t; }
419 
423   inline timeval getRecvTime() const
424 { return receptionTime; }
425 
434   inline uint32 getTimestamp() const
435 { return shiftedTimestamp; }
436 
437   inline void setTimestamp(uint32 ts)
438  { shiftedTimestamp = ts;}
439 
440  // the packet this link refers to.
441   IncomingRTPPkt* packet;
442  // the synchronization source this packet comes from.
443   SyncSourceLink* sourceLink;
444  // global incoming packet queue links.
445   IncomingRTPPktLink* prev, * next;
446  // source specific incoming packet queue links.
447   IncomingRTPPktLink* srcPrev, * srcNext;
448  // time this packet was received at
449   struct timeval receptionTime;
450  // timestamp of the packet in host order and after
451  // substracting the initial timestamp for its source
452  // (it is an increment from the initial timestamp).
453   uint32 shiftedTimestamp;
454  };
455 
472   struct SyncSourceLink
473  {
474  // 2^16
475   static const uint32 SEQNUMMOD;
476 
477   SyncSourceLink(MembershipBookkeeping* m,
478  SyncSource* s,
479  IncomingRTPPktLink* fp = NULL,
480  IncomingRTPPktLink* lp = NULL,
481  SyncSourceLink* ps = NULL,
482  SyncSourceLink* ns = NULL,
483  SyncSourceLink* ncollis = NULL) :
484  membership(m), source(s), first(fp), last(lp),
485  prev(ps), next(ns), nextCollis(ncollis),
486  prevConflict(NULL)
487  { m->setLink(*s,this); // record that the source is associated
488  initStats(); // to this link.
489  }
490 
494  ~SyncSourceLink();
495 
496   inline MembershipBookkeeping* getMembership()
497  { return membership; }
498 
503   inline SyncSource* getSource() { return source; }
504 
509   inline IncomingRTPPktLink* getFirst()
510  { return first; }
511 
512   inline void setFirst(IncomingRTPPktLink* fp)
513  { first = fp; }
514 
519   inline IncomingRTPPktLink* getLast()
520  { return last; }
521 
522   inline void setLast(IncomingRTPPktLink* lp)
523  { last = lp; }
524 
528   inline SyncSourceLink* getPrev()
529  { return prev; }
530 
531   inline void setPrev(SyncSourceLink* ps)
532  { prev = ps; }
533 
537   inline SyncSourceLink* getNext()
538  { return next; }
539 
540   inline void setNext(SyncSourceLink *ns)
541  { next = ns; }
542 
549   inline SyncSourceLink* getNextCollis()
550  { return nextCollis; }
551 
552   inline void setNextCollis(SyncSourceLink* ns)
553  { nextCollis = ns; }
554 
555   inline ConflictingTransportAddress* getPrevConflict() const
556 { return prevConflict; }
557 
561  void setPrevConflict(InetAddress& addr, tpport_t dataPort,
562  tpport_t controlPort);
563 
564   unsigned char* getSenderInfo()
565  { return senderInfo; }
566 
567  void setSenderInfo(unsigned char* si);
568 
569   unsigned char* getReceiverInfo()
570  { return receiverInfo; }
571 
572  void setReceiverInfo(unsigned char* ri);
573 
574   inline timeval getLastPacketTime() const
575 { return lastPacketTime; }
576 
577   inline timeval getLastRTCPPacketTime() const
578 { return lastRTCPPacketTime; }
579 
580   inline timeval getLastRTCPSRTime() const
581 { return lastRTCPSRTime; }
582 
587   inline uint32 getObservedPacketCount() const
588 { return obsPacketCount; }
589 
590   inline void incObservedPacketCount()
591  { obsPacketCount++; }
592 
597   inline uint32 getObservedOctetCount() const
598 { return obsOctetCount; }
599 
600   inline void incObservedOctetCount(uint32 n)
601  { obsOctetCount += n; }
602 
606  uint16
607   getMaxSeqNum() const
608 { return maxSeqNum; }
609 
614  void
615   setMaxSeqNum(uint16 max)
616  { maxSeqNum = max; }
617 
618  inline uint32
619   getExtendedMaxSeqNum() const
620 { return extendedMaxSeqNum; }
621 
622  inline void
623   setExtendedMaxSeqNum(uint32 seq)
624  { extendedMaxSeqNum = seq; }
625 
626   inline uint32 getCumulativePacketLost() const
627 { return cumulativePacketLost; }
628 
629   inline void setCumulativePacketLost(uint32 pl)
630  { cumulativePacketLost = pl; }
631 
632   inline uint8 getFractionLost() const
633 { return fractionLost; }
634 
635   inline void setFractionLost(uint8 fl)
636  { fractionLost = fl; }
637 
638   inline uint32 getLastPacketTransitTime()
639  { return lastPacketTransitTime; }
640 
641   inline void setLastPacketTransitTime(uint32 time)
642  { lastPacketTransitTime = time; }
643 
644   inline float getJitter() const
645 { return jitter; }
646 
647   inline void setJitter(float j)
648  { jitter = j; }
649 
650   inline uint32 getInitialDataTimestamp() const
651 { return initialDataTimestamp; }
652 
653   inline void setInitialDataTimestamp(uint32 ts)
654  { initialDataTimestamp = ts; }
655 
656   inline timeval getInitialDataTime() const
657 { return initialDataTime; }
658 
659   inline void setInitialDataTime(timeval it)
660  { initialDataTime = it; }
661 
669   bool getGoodbye()
670  {
671  if(!flag)
672  return false;
673  flag = false;
674  return true;
675  }
676 
683   bool getHello() {
684  if(flag)
685  return false;
686  flag = true;
687  return true;
688  }
689 
690   inline uint32 getBadSeqNum() const
691 { return badSeqNum; }
692 
693   inline void setBadSeqNum(uint32 seq)
694  { badSeqNum = seq; }
695 
696   uint8 getProbation() const
697 { return probation; }
698 
699   inline void setProbation(uint8 p)
700  { probation = p; }
701 
702   inline void decProbation()
703  { --probation; }
704 
705   bool isValid() const
706 { return 0 == probation; }
707 
708   inline uint16 getBaseSeqNum() const
709 { return baseSeqNum; }
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 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 #ifdef CCXX_NAMESPACES
1296 }
1297 #endif
1298 
1299 #endif //CCXX_RTP_IQUEUE_H_
1300 
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:258
IncomingDataQueue::defaultMaxPacketDropout
static const uint16 defaultMaxPacketDropout
Definition: iqueue.h:1283
ApplicationHandler::addParticipant
void addParticipant(RTPApplication &app, Participant &part)
Definition: iqueue.h:212
MembershipBookkeeping::SEQNUMMOD
static const uint32 SEQNUMMOD
Definition: iqueue.h:855
ParticipantHandler::~ParticipantHandler
virtual ~ParticipantHandler()
Definition: iqueue.h:198
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:367
Members::setMembersCount
void setMembersCount(uint32 n)
Definition: iqueue.h:74
IncomingDataQueue::SyncSourcesIterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: iqueue.h:895
SyncSource
Synchronization source in an RTP session.
Definition: sources.h:195
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:334
SyncSource::setParticipant
void setParticipant(Participant &p)
Definition: sources.h:307
ParticipantHandler::setPRIVPrefix
void setPRIVPrefix(Participant *part, const std::string val)
Definition: iqueue.h:191
IncomingDataQueue::recvLock
ThreadLock recvLock
Definition: iqueue.h:1277
AppDataUnit
Interface (envelope) to data received over RTP packets.
Definition: queuebase.h:71
CryptoContext
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:76
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:313
SyncSourceHandler::setSender
void setSender(SyncSource &source, bool active)
Definition: iqueue.h:153
ApplicationHandler::removeParticipant
void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl)
Definition: iqueue.h:216
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:707
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:149
IncomingDataQueue::end2EndDelayed
virtual bool end2EndDelayed(IncomingRTPPktLink &)
Definition: iqueue.h:1238
tpport_t
unsigned short tpport_t
Transport Protocol Ports.
Definition: address.h:86
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
Mutex
The Mutex class is used to protect a section of code so that at any given time only a single thread c...
Definition: thread.h:186
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
Members::increaseMembersCount
void increaseMembersCount()
Definition: iqueue.h:78
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:182
SyncSource::setState
void setState(State st)
Definition: sources.h:296
IncomingDataQueue::getMaxPacketMisorder
uint16 getMaxPacketMisorder() const
Definition: iqueue.h:1022
Members::increaseSendersCount
void increaseSendersCount()
Definition: iqueue.h:94
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:70
Members::getMembersCount
uint32 getMembersCount() const
Definition: iqueue.h:86
SyncSourceHandler::getLink
void * getLink(const SyncSource &source) const
This requires SyncSource - SyncSourceHandler friendship.
Definition: iqueue.h:137
ConflictHandler
To track addresses of sources conflicting with the local one.
Definition: iqueue.h:235
SyncSource::State
State
Synchronization source states during an RTP session.
Definition: sources.h:228
ApplicationHandler
Application objects modification methods.
Definition: iqueue.h:208
Participant
A class of objects representing remote participants (RTP applications) in a multimedia session...
Definition: sources.h:127
IncomingDataQueue::sourceExpirationPeriod
uint8 sourceExpirationPeriod
Definition: iqueue.h:1288
InetHostAddress
#define InetHostAddress
Definition: address.h:76
ConflictHandler::ConflictingTransportAddress::setNext
void setNext(ConflictingTransportAddress *nc)
Definition: iqueue.h:243
MembershipBookkeeping::getDefaultMembersHashSize
size_t getDefaultMembersHashSize()
Definition: iqueue.h:309
Members::getSendersCount
uint32 getSendersCount() const
Definition: iqueue.h:102
SyncSourceHandler::setNetworkAddress
void setNetworkAddress(SyncSource &source, InetAddress addr)
Definition: iqueue.h:165
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:345
ParticipantHandler::setSDESItem
void setSDESItem(Participant *part, SDESItemType item, const std::string &val)
Definition: iqueue.h:186
MembershipBookkeeping::defaultMembersHashSize
static const size_t defaultMembersHashSize
Definition: iqueue.h:854
SyncSourceHandler::setParticipant
void setParticipant(SyncSource &source, Participant &p)
Definition: iqueue.h:145
SyncSourceHandler::setDataTransportPort
void setDataTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:157
SyncSource::setLink
void setLink(void *l)
Definition: sources.h:320
ApplicationHandler::ApplicationHandler
ApplicationHandler()
Definition: iqueue.h:221
ThreadLock
The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have ...
Definition: thread.h:357
MembershipBookkeeping::getLast
SyncSourceLink * getLast()
Definition: iqueue.h:839
RTPApplication::addParticipant
void addParticipant(Participant &part)
RTPApplication::removeParticipant
void removeParticipant(ParticipantLink *part)
InetAddress
#define InetAddress
Definition: address.h:75
SyncSource::setSender
void setSender(bool active)
Mark this source as an active sender.
Definition: sources.h:303
ConflictHandler::ConflictingTransportAddress::getNetworkAddress
const InetAddress & getNetworkAddress() const
Definition: iqueue.h:246
ApplicationHandler::~ApplicationHandler
virtual ~ApplicationHandler()
Definition: iqueue.h:224
IncomingDataQueue::defaultMinValidPacketSequence
static const uint8 defaultMinValidPacketSequence
Definition: iqueue.h:1281
__EXPORT
#define __EXPORT
Definition: audio2.h:51
MembershipBookkeeping::setMembersCount
void setMembersCount(uint32 n)
Definition: iqueue.h:847
ConflictHandler::ConflictHandler
ConflictHandler()
Definition: iqueue.h:282
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:323
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:301
IncomingDataQueue::recvLast
IncomingRTPPktLink * recvLast
Definition: iqueue.h:1279
ConflictHandler::~ConflictHandler
virtual ~ConflictHandler()
Definition: iqueue.h:285
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:288
ParticipantHandler::ParticipantHandler
ParticipantHandler()
Definition: iqueue.h:195
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:98
Members::decreaseMembersCount
void decreaseMembersCount()
Definition: iqueue.h:82
SyncSourceHandler::setLink
void setLink(SyncSource &source, void *link)
Definition: iqueue.h:141
Members::setSendersCount
void setSendersCount(uint32 n)
Definition: iqueue.h:90
IncomingDataQueue::SyncSourcesIterator::SyncSourcesIterator
SyncSourcesIterator(const SyncSourcesIterator &si)
Definition: iqueue.h:905
SyncSource::setDataTransportPort
void setDataTransportPort(tpport_t p)
Definition: sources.h:310
SyncSourceHandler::SyncSourceHandler
SyncSourceHandler()
Definition: iqueue.h:169
MembershipBookkeeping::getLink
SyncSourceLink * getLink(const SyncSource &source) const
Definition: iqueue.h:339
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:127
IncomingDataQueue::end
SyncSourcesIterator end()
Definition: iqueue.h:941
ConflictHandler::updateConflict
void updateConflict(ConflictingTransportAddress &ca)
Definition: iqueue.h:276
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:249
Participant::setPRIVPrefix
void setPRIVPrefix(const std::string val)
Set prefix value for the PRIV SDES item.
Definition: sources.h:180
SyncSourceHandler::~SyncSourceHandler
virtual ~SyncSourceHandler()
Definition: iqueue.h:172
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:67
ConflictHandler::ConflictingTransportAddress::getControlTransportPort
tpport_t getControlTransportPort() const
Definition: iqueue.h:252
Participant::setSDESItem
void setSDESItem(SDESItemType item, const std::string &val)
Set the value of a SDES item.
Definition: sources.h:173
Members::members
uint32 members
number of identified members
Definition: iqueue.h:116
Members::activeSenders
uint32 activeSenders
number of identified members that currently are active senders
Definition: iqueue.h:118
Members::Members
Members()
Definition: iqueue.h:106
Members::~Members
virtual ~Members()
Definition: iqueue.h:111
SyncSourceHandler::setControlTransportPort
void setControlTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:161
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:316

Generated on Dec 21, 2017 for commoncpp2-1.8.1, ccrtp-1.7.2, libzrtpcpp-2.3.4, ccscript3-1.1.7, ccaudio2-1.0.0 and bayonne2-2.3.2 (after installation in /usr/local/) by   doxygen 1.8.6

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