ccRTP
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
51NAMESPACE_COMMONCPP
52
67class __EXPORT Members
68{
69public:
70 inline void
72 { members = n; }
73
74 inline void
76 { members++; }
77
78 inline void
80 { members--; }
81
82 inline uint32
84 { return members; }
85
86 inline void
88 { activeSenders = n; }
89
90 inline void
92 { activeSenders++; }
93
94 inline void
96 { activeSenders--; }
97
98 inline uint32
100 { return activeSenders; }
101
102protected:
104 members(0),
105 activeSenders(0)
106 { }
107
108 inline virtual ~Members()
109 { }
110
111private:
113 uint32 members;
115 uint32 activeSenders;
116};
117
124class __EXPORT SyncSourceHandler
125{
126public:
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
143 { source.setParticipant(p); }
144
145 inline void
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
159 { source.setControlTransportPort(p); }
160
161 inline void
162 setNetworkAddress(SyncSource& source, InetAddress addr)
163 { source.setNetworkAddress(addr); }
164
165protected:
167 { }
168
169 inline virtual ~SyncSourceHandler()
170 { }
171};
172
179class __EXPORT ParticipantHandler
180{
181public:
182 inline void
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
191protected:
193 { }
194
195 inline virtual ~ParticipantHandler()
196 { }
197};
198
205class __EXPORT ApplicationHandler
206{
207public:
208 inline void
210 { app.addParticipant(part); }
211
212 inline void
214 RTPApplication::ParticipantLink* pl)
215 { app.removeParticipant(pl); }
216
217protected:
219 { }
220
221 inline virtual ~ApplicationHandler()
222 { }
223};
224
232class __EXPORT ConflictHandler
233{
234public:
236 {
238 tpport_t dtp, tpport_t ctp);
239
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;
256 // arrival time of last data or control packet.
258 };
259
265 tpport_t dtp);
271 tpport_t ctp);
272
274 { SysTime::gettimeofday(&(ca.lastPacketTime),NULL); }
275
276 void addConflict(const InetAddress& na, tpport_t dtp, tpport_t ctp);
277
278protected:
280 { firstConflict = lastConflict = NULL; }
281
282 inline virtual ~ConflictHandler()
283 { }
284
286};
287
298class __EXPORT MembershipBookkeeping :
299 public SyncSourceHandler,
300 public ParticipantHandler,
301 public ApplicationHandler,
302 public ConflictHandler,
303 private Members
304{
305public:
307 { return defaultMembersHashSize; }
308
309protected:
310
324 MembershipBookkeeping(uint32 initialSize = defaultMembersHashSize);
325
330 inline virtual
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
352 {
354 struct timeval& recv_ts,
355 uint32 shifted_ts,
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
369 { }
370
372 { return sourceLink; }
373
375 { sourceLink = src; }
376
378 { return next; }
379
381 { next = nl; }
382
384 { return prev; }
385
387 { prev = pl; }
388
390 { return srcNext; }
391
393 { srcNext = sn; }
394
396 { return srcPrev; }
397
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.
439 // the synchronization source this packet comes from.
441 // global incoming packet queue links.
443 // source specific incoming packet queue links.
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).
451 };
452
470 {
471 // 2^16
472 static const uint32 SEQNUMMOD;
473
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
492
494 { return membership; }
495
500 inline SyncSource* getSource() { return source; }
501
507 { return first; }
508
510 { first = fp; }
511
517 { return last; }
518
520 { last = lp; }
521
526 { return prev; }
527
528 inline void setPrev(SyncSourceLink* ps)
529 { prev = ps; }
530
535 { return next; }
536
537 inline void setNext(SyncSourceLink *ns)
538 { next = ns; }
539
547 { return nextCollis; }
548
550 { nextCollis = ns; }
551
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
588 { obsPacketCount++; }
589
594 inline uint32 getObservedOctetCount() const
595 { return obsOctetCount; }
596
597 inline void incObservedOctetCount(uint32 n)
598 { obsOctetCount += n; }
599
603 uint16
605 { return maxSeqNum; }
606
611 void
612 setMaxSeqNum(uint16 max)
613 { maxSeqNum = max; }
614
615 inline uint32
617 { return extendedMaxSeqNum; }
618
619 inline void
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
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
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
734
735 void initStats();
736
742
744 // The source this link object refers to.
746 // first/last packets from this source in the queue.
748 // Links for synchronization sources located before
749 // and after this one in the list of sources.
751 // Prev and next inside the hash table collision list.
754 unsigned char* senderInfo;
755 unsigned char* receiverInfo;
756 // time the last RTP packet from this source was
757 // received at.
759 // time the last RTCP packet was received.
761 // time the lasrt RTCP SR was received. Required for
762 // DLSR computation.
764
765 // for outgoing RR reports.
766 // number of packets received from this source.
768 // number of octets received from this source.
770 // the higher sequence number seen from this source
771 uint16 maxSeqNum;
775 // for interarrivel jitter computation
777 // interarrival jitter of packets from this source.
778 float jitter;
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.
793 };
794
799 bool
800 isRegistered(uint32 ssrc);
801
811 getSourceBySSRC(uint32 ssrc, bool& created);
812
823 bool
824 BYESource(uint32 ssrc);
825
833 bool
834 removeSource(uint32 ssrc);
835
837 { return first; }
838
840 { return last; }
841
842 inline uint32
844 { return Members::getMembersCount(); }
845
846 inline void
849
850 inline uint32
852 { return Members::getSendersCount(); }
853
854 static const size_t defaultMembersHashSize;
855 static const uint32 SEQNUMMOD;
856
857private:
859
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
884 protected MembershipBookkeeping
885{
886public:
893 {
894 public:
895 typedef std::forward_iterator_tag iterator_category;
897 typedef std::ptrdiff_t difference_type;
898 typedef const SyncSource* pointer;
899 typedef const SyncSource& reference;
900
902 link(l)
903 { }
904
906 link(si.link)
907 { }
908
910 { return *(link->getSource()); }
911
913 { return link->getSource(); }
914
916 link = link->getNext();
917 return *this;
918 }
919
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
940
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
999 { minValidPacketSequence = packets; }
1000
1001 uint8
1003 { return defaultMinValidPacketSequence; }
1004
1009 uint8
1011 { return minValidPacketSequence; }
1012
1013 void
1014 setMaxPacketMisorder(uint16 packets)
1015 { maxPacketMisorder = packets; }
1016
1017 uint16
1019 { return defaultMaxPacketMisorder; }
1020
1021 uint16
1023 { return maxPacketMisorder; }
1024
1030 void
1031 setMaxPacketDropout(uint16 packets) // default: 3000.
1032 { maxPacketDropout = packets; }
1033
1034 uint16
1036 { return defaultMaxPacketDropout; }
1037
1038 uint16
1040 { return maxPacketDropout; }
1041
1042 // default value for constructors that allow to specify
1043 // members table s\ize
1044 inline static size_t
1046 { return defaultMembersSize; }
1047
1056 void
1058
1069 void
1071
1081
1082protected:
1086 IncomingDataQueue(uint32 size);
1087
1089 { }
1090
1104 bool is_new, InetAddress& na,
1105 tpport_t tp);
1106
1122 void setSourceExpirationPeriod(uint8 intervals)
1123 { sourceExpirationPeriod = intervals; }
1124
1131 virtual size_t
1133
1135
1146 getWaiting(uint32 timestamp, const SyncSource *src = NULL);
1147
1163 bool
1165 const timeval recvtime);
1166
1173 void
1175
1177
1184 inline virtual void
1186 { }
1187
1188protected:
1205 inline virtual bool
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
1239 { return false; }
1240
1256 bool
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
1276
1277 mutable ThreadLock recvLock;
1278 // reception queue
1280 // values for packet validation.
1282 static const uint16 defaultMaxPacketMisorder;
1283 static const uint16 defaultMaxPacketDropout;
1287 static const size_t defaultMembersSize;
1289 mutable Mutex cryptoMutex;
1290 std::list<CryptoContext *> cryptoContexts;
1291};
1292 // iqueue
1294
1295END_NAMESPACE
1296
1297#endif //CCXX_RTP_IQUEUE_H_
1298
Interface (envelope) to data received over RTP packets.
Definition queuebase.h:69
Application objects modification methods.
Definition iqueue.h:206
void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl)
Definition iqueue.h:213
virtual ~ApplicationHandler()
Definition iqueue.h:221
ApplicationHandler()
Definition iqueue.h:218
void addParticipant(RTPApplication &app, Participant &part)
Definition iqueue.h:209
To track addresses of sources conflicting with the local one.
Definition iqueue.h:233
virtual ~ConflictHandler()
Definition iqueue.h:282
void addConflict(const InetAddress &na, tpport_t dtp, tpport_t ctp)
ConflictingTransportAddress * firstConflict
Definition iqueue.h:285
ConflictingTransportAddress * searchDataConflict(InetAddress na, tpport_t dtp)
ConflictHandler()
Definition iqueue.h:279
void updateConflict(ConflictingTransportAddress &ca)
Definition iqueue.h:273
ConflictingTransportAddress * searchControlConflict(InetAddress na, tpport_t ctp)
The implementation for a SRTP cryptographic context.
Definition CryptoContext.h:82
iterator through the list of synchronizations sources in this session
Definition iqueue.h:893
std::ptrdiff_t difference_type
Definition iqueue.h:897
SyncSource value_type
Definition iqueue.h:896
reference operator*() const
Definition iqueue.h:909
pointer operator->() const
Definition iqueue.h:912
std::forward_iterator_tag iterator_category
Definition iqueue.h:895
friend bool operator==(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition iqueue.h:926
SyncSourcesIterator & operator++()
Definition iqueue.h:915
const SyncSource * pointer
Definition iqueue.h:898
SyncSourcesIterator operator++(int)
Definition iqueue.h:920
friend bool operator!=(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition iqueue.h:930
const SyncSource & reference
Definition iqueue.h:899
SyncSourcesIterator(SyncSourceLink *l=NULL)
Definition iqueue.h:901
SyncSourcesIterator(const SyncSourcesIterator &si)
Definition iqueue.h:905
Definition queuebase.h:296
Queue for incoming RTP data packets in an RTP session.
Definition iqueue.h:885
static const size_t defaultMembersSize
Definition iqueue.h:1287
static const uint16 defaultMaxPacketDropout
Definition iqueue.h:1283
bool insertRecvPacket(IncomingRTPPktLink *packetLink)
Insert a just received packet in the queue (both general and source specific queues).
uint16 getDefaultMaxPacketMisorder() const
Definition iqueue.h:1018
uint8 getMinValidPacketSequence() const
Get the minimun number of consecutive packets that must be received from a source before accepting it...
Definition iqueue.h:1010
bool isWaiting(const SyncSource *src=NULL) const
Determine if packets are waiting in the reception queue.
void recordExtraction(const IncomingRTPPkt &pkt)
Log extraction of a packet from this source from the scheduled reception queue.
uint32 getFirstTimestamp(const SyncSource *src=NULL) const
Get timestamp of first packet waiting in the queue.
IncomingDataQueue::IncomingRTPPktLink * getWaiting(uint32 timestamp, const SyncSource *src=NULL)
This is used to fetch a packet in the receive queue and to expire packets older than the current time...
uint16 maxPacketMisorder
Definition iqueue.h:1285
const AppDataUnit * getData(uint32 stamp, const SyncSource *src=NULL)
Retreive data from a specific timestamped packet if such a packet is currently available in the recei...
uint8 getDefaultMinValidPacketSequence() const
Definition iqueue.h:1002
virtual void onExpireRecv(IncomingRTPPkt &)
A hook to filter packets in the receive queue that are being expired.
Definition iqueue.h:1217
virtual bool end2EndDelayed(IncomingRTPPktLink &)
Definition iqueue.h:1238
void setMaxPacketMisorder(uint16 packets)
Definition iqueue.h:1014
bool recordReception(SyncSourceLink &srcLink, const IncomingRTPPkt &pkt, const timeval recvtime)
Log reception of a new RTP packet from this source.
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
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
SyncSourcesIterator end()
Definition iqueue.h:941
static size_t getDefaultMembersSize()
Definition iqueue.h:1045
void setMaxPacketDropout(uint16 packets)
It also prevents packets sent after a restart of the source being immediately accepted.
Definition iqueue.h:1031
void setInQueueCryptoContext(CryptoContext *cc)
Set input queue CryptoContext.
virtual void onNewSyncSource(const SyncSource &)
Virtual called when a new synchronization source has joined the session.
Definition iqueue.h:1185
CryptoContext * getInQueueCryptoContext(uint32 ssrc)
Get an input queue CryptoContext identified by SSRC.
uint8 minValidPacketSequence
Definition iqueue.h:1284
static const uint16 defaultMaxPacketMisorder
Definition iqueue.h:1282
uint16 getMaxPacketMisorder() const
Definition iqueue.h:1022
uint8 sourceExpirationPeriod
Definition iqueue.h:1288
IncomingRTPPktLink * recvFirst
Definition iqueue.h:1279
Mutex cryptoMutex
Definition iqueue.h:1289
virtual ~IncomingDataQueue()
Definition iqueue.h:1088
bool checkSSRCInIncomingRTPPkt(SyncSourceLink &sourceLink, bool is_new, InetAddress &na, tpport_t tp)
Apply collision and loop detection and correction algorithm when receiving RTP data packets.
void removeInQueueCryptoContext(CryptoContext *cc)
Remove input queue CryptoContext.
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
uint16 getMaxPacketDropout() const
Definition iqueue.h:1039
uint16 maxPacketDropout
Definition iqueue.h:1286
void purgeIncomingQueue()
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
uint16 getDefaultMaxPacketDropout() const
Definition iqueue.h:1035
virtual size_t getNextDataPacketSize() const =0
ThreadLock recvLock
Definition iqueue.h:1277
SyncSourcesIterator begin()
Definition iqueue.h:938
virtual size_t recvData(unsigned char *buffer, size_t length, InetHostAddress &host, tpport_t &port)=0
This function performs the physical I/O for reading a packet from the source.
IncomingDataQueue(uint32 size)
virtual size_t takeInDataPacket()
This function is used by the service thread to process the next incoming packet and place it in the r...
static const uint8 defaultMinValidPacketSequence
Definition iqueue.h:1281
std::list< CryptoContext * > cryptoContexts
Definition iqueue.h:1290
RTP packets received from other participants.
Definition rtppkt.h:705
members and senders accounting
Definition iqueue.h:68
void setMembersCount(uint32 n)
Definition iqueue.h:71
void increaseMembersCount()
Definition iqueue.h:75
void increaseSendersCount()
Definition iqueue.h:91
uint32 getSendersCount() const
Definition iqueue.h:99
void decreaseSendersCount()
Definition iqueue.h:95
void setSendersCount(uint32 n)
Definition iqueue.h:87
void decreaseMembersCount()
Definition iqueue.h:79
Members()
Definition iqueue.h:103
uint32 getMembersCount() const
Definition iqueue.h:83
virtual ~Members()
Definition iqueue.h:108
Controls the group membership in the current session.
Definition iqueue.h:304
virtual ~MembershipBookkeeping()
Purges all RTPSource structures created during the session, as well as the hash table and the list of...
Definition iqueue.h:331
static const uint32 SEQNUMMOD
Definition iqueue.h:855
size_t getDefaultMembersHashSize()
Definition iqueue.h:306
bool isMine(const SyncSource &source) const
Get whether a synchronization source is recorded in this membership controller.
Definition iqueue.h:342
SyncSourceLink * getSourceBySSRC(uint32 ssrc, bool &created)
Get the description of a source by its ssrc identifier.
void setMembersCount(uint32 n)
Definition iqueue.h:847
static const size_t defaultMembersHashSize
Definition iqueue.h:854
SyncSourceLink * getFirst()
Definition iqueue.h:836
uint32 getSendersCount()
Definition iqueue.h:851
SyncSourceLink * getLink(const SyncSource &source) const
Definition iqueue.h:336
uint32 getMembersCount()
Definition iqueue.h:843
bool BYESource(uint32 ssrc)
Mark the source identified by ssrc as having sent a BYE packet.
bool removeSource(uint32 ssrc)
Remove the description of the source identified by ssrc
bool isRegistered(uint32 ssrc)
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
MembershipBookkeeping(uint32 initialSize=defaultMembersHashSize)
The initial size is a hint to allocate the resources needed in order to keep the members' identifiers...
SyncSourceLink * getLast()
Definition iqueue.h:839
Participant objects modification methods.
Definition iqueue.h:180
void setSDESItem(Participant *part, SDESItemType item, const std::string &val)
Definition iqueue.h:183
virtual ~ParticipantHandler()
Definition iqueue.h:195
ParticipantHandler()
Definition iqueue.h:192
void setPRIVPrefix(Participant *part, const std::string val)
Definition iqueue.h:188
A class of objects representing remote participants (RTP applications) in a multimedia session.
Definition sources.h:125
An RTP application, holding identifying RTCP SDES item values.
Definition sources.h:365
SyncSource objects modification methods.
Definition iqueue.h:125
void setParticipant(SyncSource &source, Participant &p)
Definition iqueue.h:142
virtual ~SyncSourceHandler()
Definition iqueue.h:169
void setDataTransportPort(SyncSource &source, tpport_t p)
Definition iqueue.h:154
SyncSourceHandler()
Definition iqueue.h:166
void setNetworkAddress(SyncSource &source, InetAddress addr)
Definition iqueue.h:162
void setSender(SyncSource &source, bool active)
Definition iqueue.h:150
void setState(SyncSource &source, SyncSource::State ns)
Definition iqueue.h:146
void setLink(SyncSource &source, void *link)
Definition iqueue.h:138
void setControlTransportPort(SyncSource &source, tpport_t p)
Definition iqueue.h:158
void * getLink(const SyncSource &source) const
This requires SyncSource - SyncSourceHandler friendship.
Definition iqueue.h:134
Synchronization source in an RTP session.
Definition sources.h:193
State
Synchronization source states during an RTP session.
Definition sources.h:225
SDESItemType
SDES items that may be carried in a Source DEScription RTCP packet.
Definition rtcppkt.h:65
Base classes for RTP queues.
ConflictingTransportAddress(InetAddress na, tpport_t dtp, tpport_t ctp)
tpport_t getDataTransportPort() const
Definition iqueue.h:246
void setNext(ConflictingTransportAddress *nc)
Definition iqueue.h:240
tpport_t getControlTransportPort() const
Definition iqueue.h:249
timeval lastPacketTime
Definition iqueue.h:257
tpport_t dataTransportPort
Definition iqueue.h:253
ConflictingTransportAddress * next
Definition iqueue.h:255
InetAddress networkAddress
Definition iqueue.h:252
const InetAddress & getNetworkAddress() const
Definition iqueue.h:243
tpport_t controlTransportPort
Definition iqueue.h:254