ccRTP
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 NAMESPACE_COMMONCPP
53 
68 class __EXPORT Members
69 {
70 public:
71  inline void
72  setMembersCount(uint32 n)
73  { members = n; }
74 
75  inline void
77  { members++; }
78 
79  inline void
81  { members--; }
82 
83  inline uint32
85  { return members; }
86 
87  inline void
88  setSendersCount(uint32 n)
89  { activeSenders = n; }
90 
91  inline void
93  { activeSenders++; }
94 
95  inline void
97  { activeSenders--; }
98 
99  inline uint32
101  { return activeSenders; }
102 
103 protected:
105  members(0),
106  activeSenders(0)
107  { }
108 
109  inline virtual ~Members()
110  { }
111 
112 private:
114  uint32 members;
116  uint32 activeSenders;
117 };
118 
125 class __EXPORT SyncSourceHandler
126 {
127 public:
134  inline void*
135  getLink(const SyncSource& source) const
136  { return source.getLink(); }
137 
138  inline void
139  setLink(SyncSource& source, void* link)
140  { source.setLink(link); }
141 
142  inline void
144  { source.setParticipant(p); }
145 
146  inline void
148  { source.setState(ns); }
149 
150  inline void
151  setSender(SyncSource& source, bool active)
152  { source.setSender(active); }
153 
154  inline void
155  setDataTransportPort(SyncSource& source, tpport_t p)
156  { source.setDataTransportPort(p); }
157 
158  inline void
159  setControlTransportPort(SyncSource& source, tpport_t p)
160  { source.setControlTransportPort(p); }
161 
162  inline void
163  setNetworkAddress(SyncSource& source, InetAddress addr)
164  { source.setNetworkAddress(addr); }
165 
166 protected:
168  { }
169 
170  inline virtual ~SyncSourceHandler()
171  { }
172 };
173 
180 class __EXPORT ParticipantHandler
181 {
182 public:
183  inline void
185  const std::string& val)
186  { part->setSDESItem(item,val); }
187 
188  inline void
189  setPRIVPrefix(Participant* part, const std::string val)
190  { part->setPRIVPrefix(val); }
191 
192 protected:
194  { }
195 
196  inline virtual ~ParticipantHandler()
197  { }
198 };
199 
206 class __EXPORT ApplicationHandler
207 {
208 public:
209  inline void
211  { app.addParticipant(part); }
212 
213  inline void
215  RTPApplication::ParticipantLink* pl)
216  { app.removeParticipant(pl); }
217 
218 protected:
220  { }
221 
222  inline virtual ~ApplicationHandler()
223  { }
224 };
225 
233 class __EXPORT ConflictHandler
234 {
235 public:
237  {
238  ConflictingTransportAddress(InetAddress na,
239  tpport_t dtp, tpport_t ctp);
240 
242  { next = nc; }
243 
244  inline const InetAddress& getNetworkAddress( ) const
245  { return networkAddress; }
246 
247  inline tpport_t getDataTransportPort() const
248  { return dataTransportPort; }
249 
250  inline tpport_t getControlTransportPort() const
251  { return controlTransportPort; }
252 
253  InetAddress networkAddress;
257  // arrival time of last data or control packet.
258  timeval lastPacketTime;
259  };
260 
265  ConflictingTransportAddress* searchDataConflict(InetAddress na,
266  tpport_t dtp);
271  ConflictingTransportAddress* searchControlConflict(InetAddress na,
272  tpport_t ctp);
273 
275  { SysTime::gettimeofday(&(ca.lastPacketTime),NULL); }
276 
277  void addConflict(const InetAddress& na, tpport_t dtp, tpport_t ctp);
278 
279 protected:
281  { firstConflict = lastConflict = NULL; }
282 
283  inline virtual ~ConflictHandler()
284  { }
285 
287 };
288 
299 class __EXPORT MembershipBookkeeping :
300  public SyncSourceHandler,
301  public ParticipantHandler,
302  public ApplicationHandler,
303  public ConflictHandler,
304  private Members
305 {
306 public:
308  { return defaultMembersHashSize; }
309 
310 protected:
311 
325  MembershipBookkeeping(uint32 initialSize = defaultMembersHashSize);
326 
331  inline virtual
333  { endMembers(); }
334 
335  struct SyncSourceLink;
336 
337  inline SyncSourceLink* getLink(const SyncSource& source) const
338  { return static_cast<SyncSourceLink*>(SyncSourceHandler::getLink(source)); }
343  inline bool isMine(const SyncSource& source) const
344  { return getLink(source)->getMembership() == this; }
345 
353  {
355  struct timeval& recv_ts,
356  uint32 shifted_ts,
357  IncomingRTPPktLink* sp,
358  IncomingRTPPktLink* sn,
360  IncomingRTPPktLink* n) :
361  packet(pkt),
362  sourceLink(sLink),
363  prev(p), next(n),
364  srcPrev(sp), srcNext(sn),
365  receptionTime(recv_ts),
366  shiftedTimestamp(shifted_ts)
367  { }
368 
370  { }
371 
373  { return sourceLink; }
374 
375  inline void setSourceLink(SyncSourceLink* src)
376  { sourceLink = src; }
377 
378  inline IncomingRTPPktLink* getNext() const
379  { return next; }
380 
381  inline void setNext(IncomingRTPPktLink* nl)
382  { next = nl; }
383 
384  inline IncomingRTPPktLink* getPrev() const
385  { return prev; }
386 
387  inline void setPrev(IncomingRTPPktLink* pl)
388  { prev = pl; }
389 
391  { return srcNext; }
392 
394  { srcNext = sn; }
395 
397  { return srcPrev; }
398 
400  { srcPrev = sp; }
401 
402  inline IncomingRTPPkt* getPacket() const
403  { return packet; }
404 
405  inline void setPacket(IncomingRTPPkt* pkt)
406  { packet = pkt; }
407 
415  inline void setRecvTime(const timeval &t)
416  { receptionTime = t; }
417 
421  inline timeval getRecvTime() const
422  { return receptionTime; }
423 
432  inline uint32 getTimestamp() const
433  { return shiftedTimestamp; }
434 
435  inline void setTimestamp(uint32 ts)
436  { shiftedTimestamp = ts;}
437 
438  // the packet this link refers to.
440  // the synchronization source this packet comes from.
442  // global incoming packet queue links.
444  // source specific incoming packet queue links.
446  // time this packet was received at
447  struct timeval receptionTime;
448  // timestamp of the packet in host order and after
449  // substracting the initial timestamp for its source
450  // (it is an increment from the initial timestamp).
452  };
453 
471  {
472  // 2^16
473  static const uint32 SEQNUMMOD;
474 
476  SyncSource* s,
477  IncomingRTPPktLink* fp = NULL,
478  IncomingRTPPktLink* lp = NULL,
479  SyncSourceLink* ps = NULL,
480  SyncSourceLink* ns = NULL,
481  SyncSourceLink* ncollis = NULL) :
482  membership(m), source(s), first(fp), last(lp),
483  prev(ps), next(ns), nextCollis(ncollis),
484  prevConflict(NULL)
485  { m->setLink(*s,this); // record that the source is associated
486  initStats(); // to this link.
487  }
488 
492  ~SyncSourceLink();
493 
495  { return membership; }
496 
501  inline SyncSource* getSource() { return source; }
502 
508  { return first; }
509 
510  inline void setFirst(IncomingRTPPktLink* fp)
511  { first = fp; }
512 
518  { return last; }
519 
520  inline void setLast(IncomingRTPPktLink* lp)
521  { last = lp; }
522 
527  { return prev; }
528 
529  inline void setPrev(SyncSourceLink* ps)
530  { prev = ps; }
531 
536  { return next; }
537 
538  inline void setNext(SyncSourceLink *ns)
539  { next = ns; }
540 
548  { return nextCollis; }
549 
550  inline void setNextCollis(SyncSourceLink* ns)
551  { nextCollis = ns; }
552 
553  inline ConflictingTransportAddress* getPrevConflict() const
554  { return prevConflict; }
555 
559  void setPrevConflict(InetAddress& addr, tpport_t dataPort,
560  tpport_t controlPort);
561 
562  unsigned char* getSenderInfo()
563  { return senderInfo; }
564 
565  void setSenderInfo(unsigned char* si);
566 
567  unsigned char* getReceiverInfo()
568  { return receiverInfo; }
569 
570  void setReceiverInfo(unsigned char* ri);
571 
572  inline timeval getLastPacketTime() const
573  { return lastPacketTime; }
574 
575  inline timeval getLastRTCPPacketTime() const
576  { return lastRTCPPacketTime; }
577 
578  inline timeval getLastRTCPSRTime() const
579  { return lastRTCPSRTime; }
580 
585  inline uint32 getObservedPacketCount() const
586  { return obsPacketCount; }
587 
589  { obsPacketCount++; }
590 
595  inline uint32 getObservedOctetCount() const
596  { return obsOctetCount; }
597 
598  inline void incObservedOctetCount(uint32 n)
599  { obsOctetCount += n; }
600 
604  uint16
605  getMaxSeqNum() const
606  { return maxSeqNum; }
607 
612  void
613  setMaxSeqNum(uint16 max)
614  { maxSeqNum = max; }
615 
616  inline uint32
618  { return extendedMaxSeqNum; }
619 
620  inline void
622  { extendedMaxSeqNum = seq; }
623 
624  inline uint32 getCumulativePacketLost() const
625  { return cumulativePacketLost; }
626 
627  inline void setCumulativePacketLost(uint32 pl)
628  { cumulativePacketLost = pl; }
629 
630  inline uint8 getFractionLost() const
631  { return fractionLost; }
632 
633  inline void setFractionLost(uint8 fl)
634  { fractionLost = fl; }
635 
636  inline uint32 getLastPacketTransitTime()
637  { return lastPacketTransitTime; }
638 
639  inline void setLastPacketTransitTime(uint32 time)
640  { lastPacketTransitTime = time; }
641 
642  inline float getJitter() const
643  { return jitter; }
644 
645  inline void setJitter(float j)
646  { jitter = j; }
647 
648  inline uint32 getInitialDataTimestamp() const
649  { return initialDataTimestamp; }
650 
651  inline void setInitialDataTimestamp(uint32 ts)
652  { initialDataTimestamp = ts; }
653 
654  inline timeval getInitialDataTime() const
655  { return initialDataTime; }
656 
657  inline void setInitialDataTime(timeval it)
658  { initialDataTime = it; }
659 
667  bool getGoodbye()
668  {
669  if(!flag)
670  return false;
671  flag = false;
672  return true;
673  }
674 
681  bool getHello() {
682  if(flag)
683  return false;
684  flag = true;
685  return true;
686  }
687 
688  inline uint32 getBadSeqNum() const
689  { return badSeqNum; }
690 
691  inline void setBadSeqNum(uint32 seq)
692  { badSeqNum = seq; }
693 
694  uint8 getProbation() const
695  { return probation; }
696 
697  inline void setProbation(uint8 p)
698  { probation = p; }
699 
700  inline void decProbation()
701  { --probation; }
702 
703  bool isValid() const
704  { return 0 == probation; }
705 
706  inline uint16 getBaseSeqNum() const
707  { return baseSeqNum; }
708 
709  inline void setBaseSeqNum(uint16 seqnum)
710  { baseSeqNum = seqnum; }
711 
712  inline uint32 getSeqNumAccum() const
713  { return seqNumAccum; }
714 
715  inline void incSeqNumAccum()
716  { seqNumAccum += SEQNUMMOD; }
717 
721  inline void initSequence(uint16 seqnum)
722  { maxSeqNum = seqNumAccum = seqnum; }
723 
734  void recordInsertion(const IncomingRTPPktLink& pl);
735 
736  void initStats();
737 
742  void computeStats();
743 
745  // The source this link object refers to.
747  // first/last packets from this source in the queue.
749  // Links for synchronization sources located before
750  // and after this one in the list of sources.
752  // Prev and next inside the hash table collision list.
754  ConflictingTransportAddress* prevConflict;
755  unsigned char* senderInfo;
756  unsigned char* receiverInfo;
757  // time the last RTP packet from this source was
758  // received at.
759  timeval lastPacketTime;
760  // time the last RTCP packet was received.
762  // time the lasrt RTCP SR was received. Required for
763  // DLSR computation.
764  timeval lastRTCPSRTime;
765 
766  // for outgoing RR reports.
767  // number of packets received from this source.
769  // number of octets received from this source.
771  // the higher sequence number seen from this source
772  uint16 maxSeqNum;
776  // for interarrivel jitter computation
778  // interarrival jitter of packets from this source.
779  float jitter;
782 
783  // this flag assures we only call one gotHello and one
784  // gotGoodbye for this src.
785  bool flag;
786 
787  // for source validation:
788  uint32 badSeqNum;
789  uint8 probation; // packets in sequence before valid.
790  uint16 baseSeqNum;
793  uint32 seqNumAccum;
794  };
795 
800  bool
801  isRegistered(uint32 ssrc);
802 
812  getSourceBySSRC(uint32 ssrc, bool& created);
813 
824  bool
825  BYESource(uint32 ssrc);
826 
834  bool
835  removeSource(uint32 ssrc);
836 
838  { return first; }
839 
841  { return last; }
842 
843  inline uint32
845  { return Members::getMembersCount(); }
846 
847  inline void
848  setMembersCount(uint32 n)
850 
851  inline uint32
853  { return Members::getSendersCount(); }
854 
855  static const size_t defaultMembersHashSize;
856  static const uint32 SEQNUMMOD;
857 
858 private:
860 
862  operator=(const MembershipBookkeeping &o);
863 
868  void
869  endMembers();
870 
871  // Hash table with sources of RTP and RTCP packets
872  uint32 sourceBucketsNum;
873  SyncSourceLink** sourceLinks;
874  // List of sources, ordered from older to newer
875  SyncSourceLink* first, * last;
876 };
877 
885  protected MembershipBookkeeping
886 {
887 public:
894  {
895  public:
896  typedef std::forward_iterator_tag iterator_category;
898  typedef std::ptrdiff_t difference_type;
899  typedef const SyncSource* pointer;
900  typedef const SyncSource& reference;
901 
902  SyncSourcesIterator(SyncSourceLink* l = NULL) :
903  link(l)
904  { }
905 
907  link(si.link)
908  { }
909 
911  { return *(link->getSource()); }
912 
914  { return link->getSource(); }
915 
917  link = link->getNext();
918  return *this;
919  }
920 
922  SyncSourcesIterator result(*this);
923  ++(*this);
924  return result;
925  }
926 
927  friend bool operator==(const SyncSourcesIterator& l,
928  const SyncSourcesIterator& r)
929  { return l.link == r.link; }
930 
931  friend bool operator!=(const SyncSourcesIterator& l,
932  const SyncSourcesIterator& r)
933  { return l.link != r.link; }
934 
935  private:
936  SyncSourceLink *link;
937  };
938 
941 
943  { return SyncSourcesIterator(NULL); }
944 
954  const AppDataUnit*
955  getData(uint32 stamp, const SyncSource* src = NULL);
956 
957 
964  bool
965  isWaiting(const SyncSource* src = NULL) const;
966 
973  uint32
974  getFirstTimestamp(const SyncSource* src = NULL) const;
975 
998  void
1000  { minValidPacketSequence = packets; }
1001 
1002  uint8
1004  { return defaultMinValidPacketSequence; }
1005 
1010  uint8
1012  { return minValidPacketSequence; }
1013 
1014  void
1015  setMaxPacketMisorder(uint16 packets)
1016  { maxPacketMisorder = packets; }
1017 
1018  uint16
1020  { return defaultMaxPacketMisorder; }
1021 
1022  uint16
1024  { return maxPacketMisorder; }
1025 
1031  void
1032  setMaxPacketDropout(uint16 packets) // default: 3000.
1033  { maxPacketDropout = packets; }
1034 
1035  uint16
1037  { return defaultMaxPacketDropout; }
1038 
1039  uint16
1041  { return maxPacketDropout; }
1042 
1043  // default value for constructors that allow to specify
1044  // members table s\ize
1045  inline static size_t
1047  { return defaultMembersSize; }
1048 
1057  void
1058  setInQueueCryptoContext(CryptoContext* cc);
1059 
1070  void
1071  removeInQueueCryptoContext(CryptoContext* cc);
1072 
1080  CryptoContext*
1081  getInQueueCryptoContext(uint32 ssrc);
1082 
1083 protected:
1087  IncomingDataQueue(uint32 size);
1088 
1090  { }
1091 
1104  bool checkSSRCInIncomingRTPPkt(SyncSourceLink& sourceLink,
1105  bool is_new, InetAddress& na,
1106  tpport_t tp);
1107 
1123  void setSourceExpirationPeriod(uint8 intervals)
1124  { sourceExpirationPeriod = intervals; }
1125 
1132  virtual size_t
1133  takeInDataPacket();
1134 
1135  void renewLocalSSRC();
1136 
1147  getWaiting(uint32 timestamp, const SyncSource *src = NULL);
1148 
1164  bool
1165  recordReception(SyncSourceLink& srcLink, const IncomingRTPPkt& pkt,
1166  const timeval recvtime);
1167 
1174  void
1175  recordExtraction(const IncomingRTPPkt& pkt);
1176 
1177  void purgeIncomingQueue();
1178 
1185  inline virtual void
1187  { }
1188 
1189 protected:
1206  inline virtual bool
1208  { return true; }
1209 
1218  inline virtual void onExpireRecv(IncomingRTPPkt&)
1219  { return; }
1220 
1234  inline virtual bool
1235  onSRTPPacketError(IncomingRTPPkt& pkt, int32 errorCode)
1236  { return false; }
1237 
1238  inline virtual bool
1239  end2EndDelayed(IncomingRTPPktLink&)
1240  { return false; }
1241 
1257  bool
1258  insertRecvPacket(IncomingRTPPktLink* packetLink);
1259 
1271  virtual size_t
1272  recvData(unsigned char* buffer, size_t length,
1273  InetHostAddress& host, tpport_t& port) = 0;
1274 
1275  virtual size_t
1276  getNextDataPacketSize() const = 0;
1277 
1278  mutable ThreadLock recvLock;
1279  // reception queue
1280  IncomingRTPPktLink* recvFirst, * recvLast;
1281  // values for packet validation.
1282  static const uint8 defaultMinValidPacketSequence;
1283  static const uint16 defaultMaxPacketMisorder;
1284  static const uint16 defaultMaxPacketDropout;
1288  static const size_t defaultMembersSize;
1290  mutable Mutex cryptoMutex;
1291  std::list<CryptoContext *> cryptoContexts;
1292 };
1293  // iqueue
1295 
1296 END_NAMESPACE
1297 
1298 #endif //CCXX_RTP_IQUEUE_H_
1299 
virtual void renewLocalSSRC()
Definition: queuebase.h:233
void setMaxPacketDropout(uint16 packets)
It also prevents packets sent after a restart of the source being immediately accepted.
Definition: iqueue.h:1032
void setControlTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:159
void setMembersCount(uint32 n)
Definition: iqueue.h:72
static size_t getDefaultMembersSize()
Definition: iqueue.h:1046
Definition: queuebase.h:295
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:83
virtual ~IncomingDataQueue()
Definition: iqueue.h:1089
void setLink(SyncSource &source, void *link)
Definition: iqueue.h:139
SyncSourceLink * getLink(const SyncSource &source) const
Definition: iqueue.h:337
void setState(SyncSource &source, SyncSource::State ns)
Definition: iqueue.h:147
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:1123
void setSender(SyncSource &source, bool active)
Definition: iqueue.h:151
void increaseMembersCount()
Definition: iqueue.h:76
friend bool operator!=(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:931
To track addresses of sources conflicting with the local one.
Definition: iqueue.h:233
std::forward_iterator_tag iterator_category
Definition: iqueue.h:896
void setPRIVPrefix(Participant *part, const std::string val)
Definition: iqueue.h:189
size_t getDefaultMembersHashSize()
Definition: iqueue.h:307
virtual bool end2EndDelayed(IncomingRTPPktLink &)
Definition: iqueue.h:1239
uint8 getMinValidPacketSequence() const
Get the minimun number of consecutive packets that must be received from a source before accepting it...
Definition: iqueue.h:1011
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:1207
void * getLink(const SyncSource &source) const
This requires SyncSource - SyncSourceHandler friendship.
Definition: iqueue.h:135
void decreaseSendersCount()
Definition: iqueue.h:96
virtual bool onSRTPPacketError(IncomingRTPPkt &pkt, int32 errorCode)
A hook that gets called if the decoding of an incoming SRTP was erroneous.
Definition: iqueue.h:1235
tpport_t getDataTransportPort() const
Definition: iqueue.h:247
Members()
Definition: iqueue.h:104
Queue for incoming RTP data packets in an RTP session.
Definition: iqueue.h:884
ConflictingTransportAddress * lastConflict
Definition: iqueue.h:286
uint16 getMaxPacketMisorder() const
Definition: iqueue.h:1023
void increaseSendersCount()
Definition: iqueue.h:92
uint16 getDefaultMaxPacketMisorder() const
Definition: iqueue.h:1019
reference operator*() const
Definition: iqueue.h:910
SyncSource objects modification methods.
Definition: iqueue.h:125
uint32 getMembersCount()
Definition: iqueue.h:844
virtual ~ConflictHandler()
Definition: iqueue.h:283
uint16 maxPacketMisorder
Definition: iqueue.h:1286
tpport_t controlTransportPort
Definition: iqueue.h:255
State
Synchronization source states during an RTP session.
Definition: sources.h:227
Synchronization source in an RTP session.
Definition: sources.h:194
void setParticipant(SyncSource &source, Participant &p)
Definition: iqueue.h:143
Participant objects modification methods.
Definition: iqueue.h:180
IncomingRTPPktLink * recvLast
Definition: iqueue.h:1280
SyncSourcesIterator end()
Definition: iqueue.h:942
SyncSourcesIterator operator++(int)
Definition: iqueue.h:921
Interface (envelope) to data received over RTP packets.
Definition: queuebase.h:69
uint16 getDefaultMaxPacketDropout() const
Definition: iqueue.h:1036
uint32 getSendersCount() const
Definition: iqueue.h:100
SyncSourcesIterator(SyncSourceLink *l=NULL)
Definition: iqueue.h:902
friend bool operator==(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:927
void setNetworkAddress(SyncSource &source, InetAddress addr)
Definition: iqueue.h:163
SyncSourcesIterator begin()
Definition: iqueue.h:939
Base classes for RTP queues.
static const size_t defaultMembersSize
Definition: iqueue.h:1288
void addParticipant(RTPApplication &app, Participant &part)
Definition: iqueue.h:210
uint32 getMembersCount() const
Definition: iqueue.h:84
uint16 maxPacketDropout
Definition: iqueue.h:1287
uint8 getDefaultMinValidPacketSequence() const
Definition: iqueue.h:1003
SyncSourceHandler()
Definition: iqueue.h:167
uint8 minValidPacketSequence
Definition: iqueue.h:1285
tpport_t dataTransportPort
Definition: iqueue.h:254
void setMembersCount(uint32 n)
Definition: iqueue.h:848
void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl)
Definition: iqueue.h:214
ApplicationHandler()
Definition: iqueue.h:219
void setDataTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:155
An RTP application, holding identifying RTCP SDES item values.
Definition: sources.h:366
static const uint32 SEQNUMMOD
Definition: iqueue.h:856
void decreaseMembersCount()
Definition: iqueue.h:80
static const uint8 defaultMinValidPacketSequence
Definition: iqueue.h:1282
void setNext(ConflictingTransportAddress *nc)
Definition: iqueue.h:241
uint16 getMaxPacketDropout() const
Definition: iqueue.h:1040
const InetAddress & getNetworkAddress() const
Definition: iqueue.h:244
std::ptrdiff_t difference_type
Definition: iqueue.h:898
RTP packets received from other participants.
Definition: rtppkt.h:705
ParticipantHandler()
Definition: iqueue.h:193
iterator through the list of synchronizations sources in this session
Definition: iqueue.h:893
ConflictHandler()
Definition: iqueue.h:280
ThreadLock recvLock
Definition: iqueue.h:1278
virtual ~ApplicationHandler()
Definition: iqueue.h:222
static const size_t defaultMembersHashSize
Definition: iqueue.h:855
std::list< CryptoContext * > cryptoContexts
Definition: iqueue.h:1291
static const uint16 defaultMaxPacketMisorder
Definition: iqueue.h:1283
virtual ~Members()
Definition: iqueue.h:109
timeval lastPacketTime
Definition: iqueue.h:258
Mutex cryptoMutex
Definition: iqueue.h:1290
ConflictingTransportAddress * next
Definition: iqueue.h:256
SyncSourcesIterator & operator++()
Definition: iqueue.h:916
pointer operator->() const
Definition: iqueue.h:913
virtual void onExpireRecv(IncomingRTPPkt &)
A hook to filter packets in the receive queue that are being expired.
Definition: iqueue.h:1218
const SyncSource & reference
Definition: iqueue.h:900
members and senders accounting
Definition: iqueue.h:68
virtual void onNewSyncSource(const SyncSource &)
Virtual called when a new synchronization source has joined the session.
Definition: iqueue.h:1186
void updateConflict(ConflictingTransportAddress &ca)
Definition: iqueue.h:274
static const uint16 defaultMaxPacketDropout
Definition: iqueue.h:1284
bool isMine(const SyncSource &source) const
Get whether a synchronization source is recorded in this membership controller.
Definition: iqueue.h:343
SyncSourcesIterator(const SyncSourcesIterator &si)
Definition: iqueue.h:906
uint8 sourceExpirationPeriod
Definition: iqueue.h:1289
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:999
void setSDESItem(Participant *part, SDESItemType item, const std::string &val)
Definition: iqueue.h:184
virtual ~SyncSourceHandler()
Definition: iqueue.h:170
const SyncSource * pointer
Definition: iqueue.h:899
Application objects modification methods.
Definition: iqueue.h:206
SyncSourceLink * getLast()
Definition: iqueue.h:840
InetAddress networkAddress
Definition: iqueue.h:253
SyncSource value_type
Definition: iqueue.h:897
void setSendersCount(uint32 n)
Definition: iqueue.h:88
uint32 getSendersCount()
Definition: iqueue.h:852
A class of objects representing remote participants (RTP applications) in a multimedia session...
Definition: sources.h:126
virtual ~MembershipBookkeeping()
Purges all RTPSource structures created during the session, as well as the hash table and the list of...
Definition: iqueue.h:332
SDESItemType
SDES items that may be carried in a Source DEScription RTCP packet.
Definition: rtcppkt.h:65
Controls the group membership in the current session.
Definition: iqueue.h:299
virtual ~ParticipantHandler()
Definition: iqueue.h:196
tpport_t getControlTransportPort() const
Definition: iqueue.h:250
SyncSourceLink * getFirst()
Definition: iqueue.h:837
void setMaxPacketMisorder(uint16 packets)
Definition: iqueue.h:1015