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
52NAMESPACE_COMMONCPP
53
68class __EXPORT Members
69{
70public:
71 inline void
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
89 { activeSenders = n; }
90
91 inline void
93 { activeSenders++; }
94
95 inline void
97 { activeSenders--; }
98
99 inline uint32
101 { return activeSenders; }
102
103protected:
105 members(0),
106 activeSenders(0)
107 { }
108
109 inline virtual ~Members()
110 { }
111
112private:
114 uint32 members;
116 uint32 activeSenders;
117};
118
125class __EXPORT SyncSourceHandler
126{
127public:
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
160 { source.setControlTransportPort(p); }
161
162 inline void
163 setNetworkAddress(SyncSource& source, InetAddress addr)
164 { source.setNetworkAddress(addr); }
165
166protected:
168 { }
169
170 inline virtual ~SyncSourceHandler()
171 { }
172};
173
180class __EXPORT ParticipantHandler
181{
182public:
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
192protected:
194 { }
195
196 inline virtual ~ParticipantHandler()
197 { }
198};
199
206class __EXPORT ApplicationHandler
207{
208public:
209 inline void
211 { app.addParticipant(part); }
212
213 inline void
215 RTPApplication::ParticipantLink* pl)
216 { app.removeParticipant(pl); }
217
218protected:
220 { }
221
222 inline virtual ~ApplicationHandler()
223 { }
224};
225
233class __EXPORT ConflictHandler
234{
235public:
237 {
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.
259 };
260
266 tpport_t dtp);
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
279protected:
281 { firstConflict = lastConflict = NULL; }
282
283 inline virtual ~ConflictHandler()
284 { }
285
287};
288
299class __EXPORT MembershipBookkeeping :
300 public SyncSourceHandler,
301 public ParticipantHandler,
302 public ApplicationHandler,
303 public ConflictHandler,
304 private Members
305{
306public:
308 { return defaultMembersHashSize; }
309
310protected:
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,
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
376 { sourceLink = src; }
377
379 { return next; }
380
382 { next = nl; }
383
385 { return prev; }
386
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
493
495 { return membership; }
496
501 inline SyncSource* getSource() { return source; }
502
508 { return first; }
509
511 { first = fp; }
512
518 { return last; }
519
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
551 { nextCollis = ns; }
552
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
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
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
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
735
736 void initStats();
737
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.
755 unsigned char* senderInfo;
756 unsigned char* receiverInfo;
757 // time the last RTP packet from this source was
758 // received at.
760 // time the last RTCP packet was received.
762 // time the lasrt RTCP SR was received. Required for
763 // DLSR computation.
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.
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
850
851 inline uint32
853 { return Members::getSendersCount(); }
854
855 static const size_t defaultMembersHashSize;
856 static const uint32 SEQNUMMOD;
857
858private:
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{
887public:
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
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
1059
1070 void
1072
1082
1083protected:
1087 IncomingDataQueue(uint32 size);
1088
1090 { }
1091
1105 bool is_new, InetAddress& na,
1106 tpport_t tp);
1107
1123 void setSourceExpirationPeriod(uint8 intervals)
1124 { sourceExpirationPeriod = intervals; }
1125
1132 virtual size_t
1134
1136
1147 getWaiting(uint32 timestamp, const SyncSource *src = NULL);
1148
1164 bool
1166 const timeval recvtime);
1167
1174 void
1176
1178
1185 inline virtual void
1187 { }
1188
1189protected:
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
1240 { return false; }
1241
1257 bool
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
1277
1278 mutable ThreadLock recvLock;
1279 // reception queue
1281 // values for packet validation.
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
1296END_NAMESPACE
1297
1298#endif //CCXX_RTP_IQUEUE_H_
1299
Interface (envelope) to data received over RTP packets.
Definition: queuebase.h:70
Application objects modification methods.
Definition: iqueue.h:207
void removeParticipant(RTPApplication &app, RTPApplication::ParticipantLink *pl)
Definition: iqueue.h:214
virtual ~ApplicationHandler()
Definition: iqueue.h:222
ApplicationHandler()
Definition: iqueue.h:219
void addParticipant(RTPApplication &app, Participant &part)
Definition: iqueue.h:210
To track addresses of sources conflicting with the local one.
Definition: iqueue.h:234
virtual ~ConflictHandler()
Definition: iqueue.h:283
void addConflict(const InetAddress &na, tpport_t dtp, tpport_t ctp)
ConflictingTransportAddress * firstConflict
Definition: iqueue.h:286
ConflictingTransportAddress * searchDataConflict(InetAddress na, tpport_t dtp)
ConflictHandler()
Definition: iqueue.h:280
void updateConflict(ConflictingTransportAddress &ca)
Definition: iqueue.h:274
ConflictingTransportAddress * searchControlConflict(InetAddress na, tpport_t ctp)
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:83
iterator through the list of synchronizations sources in this session
Definition: iqueue.h:894
std::ptrdiff_t difference_type
Definition: iqueue.h:898
SyncSource value_type
Definition: iqueue.h:897
reference operator*() const
Definition: iqueue.h:910
pointer operator->() const
Definition: iqueue.h:913
std::forward_iterator_tag iterator_category
Definition: iqueue.h:896
friend bool operator==(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:927
SyncSourcesIterator & operator++()
Definition: iqueue.h:916
const SyncSource * pointer
Definition: iqueue.h:899
SyncSourcesIterator operator++(int)
Definition: iqueue.h:921
friend bool operator!=(const SyncSourcesIterator &l, const SyncSourcesIterator &r)
Definition: iqueue.h:931
const SyncSource & reference
Definition: iqueue.h:900
SyncSourcesIterator(SyncSourceLink *l=NULL)
Definition: iqueue.h:902
SyncSourcesIterator(const SyncSourcesIterator &si)
Definition: iqueue.h:906
Definition: queuebase.h:297
Queue for incoming RTP data packets in an RTP session.
Definition: iqueue.h:886
static const size_t defaultMembersSize
Definition: iqueue.h:1288
static const uint16 defaultMaxPacketDropout
Definition: iqueue.h:1284
bool insertRecvPacket(IncomingRTPPktLink *packetLink)
Insert a just received packet in the queue (both general and source specific queues).
uint16 getDefaultMaxPacketMisorder() const
Definition: iqueue.h:1019
uint8 getMinValidPacketSequence() const
Get the minimun number of consecutive packets that must be received from a source before accepting it...
Definition: iqueue.h:1011
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:1286
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:1003
virtual void onExpireRecv(IncomingRTPPkt &)
A hook to filter packets in the receive queue that are being expired.
Definition: iqueue.h:1218
virtual bool end2EndDelayed(IncomingRTPPktLink &)
Definition: iqueue.h:1239
void setMaxPacketMisorder(uint16 packets)
Definition: iqueue.h:1015
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:999
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
SyncSourcesIterator end()
Definition: iqueue.h:942
static size_t getDefaultMembersSize()
Definition: iqueue.h:1046
void setMaxPacketDropout(uint16 packets)
It also prevents packets sent after a restart of the source being immediately accepted.
Definition: iqueue.h:1032
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:1186
CryptoContext * getInQueueCryptoContext(uint32 ssrc)
Get an input queue CryptoContext identified by SSRC.
uint8 minValidPacketSequence
Definition: iqueue.h:1285
static const uint16 defaultMaxPacketMisorder
Definition: iqueue.h:1283
uint16 getMaxPacketMisorder() const
Definition: iqueue.h:1023
uint8 sourceExpirationPeriod
Definition: iqueue.h:1289
IncomingRTPPktLink * recvFirst
Definition: iqueue.h:1280
Mutex cryptoMutex
Definition: iqueue.h:1290
virtual ~IncomingDataQueue()
Definition: iqueue.h:1089
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:1235
uint16 getMaxPacketDropout() const
Definition: iqueue.h:1040
uint16 maxPacketDropout
Definition: iqueue.h:1287
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:1207
uint16 getDefaultMaxPacketDropout() const
Definition: iqueue.h:1036
virtual size_t getNextDataPacketSize() const =0
ThreadLock recvLock
Definition: iqueue.h:1278
SyncSourcesIterator begin()
Definition: iqueue.h:939
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:1282
std::list< CryptoContext * > cryptoContexts
Definition: iqueue.h:1291
RTP packets received from other participants.
Definition: rtppkt.h:706
members and senders accounting
Definition: iqueue.h:69
void setMembersCount(uint32 n)
Definition: iqueue.h:72
void increaseMembersCount()
Definition: iqueue.h:76
void increaseSendersCount()
Definition: iqueue.h:92
uint32 getSendersCount() const
Definition: iqueue.h:100
void decreaseSendersCount()
Definition: iqueue.h:96
void setSendersCount(uint32 n)
Definition: iqueue.h:88
void decreaseMembersCount()
Definition: iqueue.h:80
Members()
Definition: iqueue.h:104
uint32 getMembersCount() const
Definition: iqueue.h:84
virtual ~Members()
Definition: iqueue.h:109
Controls the group membership in the current session.
Definition: iqueue.h:305
virtual ~MembershipBookkeeping()
Purges all RTPSource structures created during the session, as well as the hash table and the list of...
Definition: iqueue.h:332
static const uint32 SEQNUMMOD
Definition: iqueue.h:856
size_t getDefaultMembersHashSize()
Definition: iqueue.h:307
bool isMine(const SyncSource &source) const
Get whether a synchronization source is recorded in this membership controller.
Definition: iqueue.h:343
SyncSourceLink * getSourceBySSRC(uint32 ssrc, bool &created)
Get the description of a source by its ssrc identifier.
void setMembersCount(uint32 n)
Definition: iqueue.h:848
static const size_t defaultMembersHashSize
Definition: iqueue.h:855
SyncSourceLink * getFirst()
Definition: iqueue.h:837
uint32 getSendersCount()
Definition: iqueue.h:852
SyncSourceLink * getLink(const SyncSource &source) const
Definition: iqueue.h:337
uint32 getMembersCount()
Definition: iqueue.h:844
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:840
Participant objects modification methods.
Definition: iqueue.h:181
void setSDESItem(Participant *part, SDESItemType item, const std::string &val)
Definition: iqueue.h:184
virtual ~ParticipantHandler()
Definition: iqueue.h:196
ParticipantHandler()
Definition: iqueue.h:193
void setPRIVPrefix(Participant *part, const std::string val)
Definition: iqueue.h:189
A class of objects representing remote participants (RTP applications) in a multimedia session.
Definition: sources.h:127
An RTP application, holding identifying RTCP SDES item values.
Definition: sources.h:367
SyncSource objects modification methods.
Definition: iqueue.h:126
void setParticipant(SyncSource &source, Participant &p)
Definition: iqueue.h:143
virtual ~SyncSourceHandler()
Definition: iqueue.h:170
void setDataTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:155
SyncSourceHandler()
Definition: iqueue.h:167
void setNetworkAddress(SyncSource &source, InetAddress addr)
Definition: iqueue.h:163
void setSender(SyncSource &source, bool active)
Definition: iqueue.h:151
void setState(SyncSource &source, SyncSource::State ns)
Definition: iqueue.h:147
void setLink(SyncSource &source, void *link)
Definition: iqueue.h:139
void setControlTransportPort(SyncSource &source, tpport_t p)
Definition: iqueue.h:159
void * getLink(const SyncSource &source) const
This requires SyncSource - SyncSourceHandler friendship.
Definition: iqueue.h:135
Synchronization source in an RTP session.
Definition: sources.h:195
State
Synchronization source states during an RTP session.
Definition: sources.h:227
SDESItemType
SDES items that may be carried in a Source DEScription RTCP packet.
Definition: rtcppkt.h:66
Base classes for RTP queues.
ConflictingTransportAddress(InetAddress na, tpport_t dtp, tpport_t ctp)
tpport_t getDataTransportPort() const
Definition: iqueue.h:247
void setNext(ConflictingTransportAddress *nc)
Definition: iqueue.h:241
tpport_t getControlTransportPort() const
Definition: iqueue.h:250
timeval lastPacketTime
Definition: iqueue.h:258
tpport_t dataTransportPort
Definition: iqueue.h:254
ConflictingTransportAddress * next
Definition: iqueue.h:256
InetAddress networkAddress
Definition: iqueue.h:253
const InetAddress & getNetworkAddress() const
Definition: iqueue.h:244
tpport_t controlTransportPort
Definition: iqueue.h:255