59 #ifdef CCXX_EXCEPTIONS
66 #ifdef CCXX_EXCEPTIONS
74 lastPacketTime.tv_sec = lastPacketTime.tv_usec = 0;
75 lastRTCPPacketTime.tv_sec = lastRTCPPacketTime.tv_usec = 0;
76 lastRTCPSRTime.tv_sec = lastRTCPSRTime.tv_usec = 0;
81 obsPacketCount = obsOctetCount = 0;
82 maxSeqNum = extendedMaxSeqNum = 0;
83 cumulativePacketLost = 0;
86 initialDataTimestamp = 0;
87 initialDataTime.tv_sec = initialDataTime.tv_usec = 0;
104 setExtendedMaxSeqNum(getMaxSeqNum() + getSeqNumAccum());
106 (getExtendedMaxSeqNum() - getBaseSeqNum() + 1);
107 uint32 pc = getObservedPacketCount();
112 lost = expected - pc;
113 setCumulativePacketLost(lost);
117 uint32 expectedDelta = expected - expectedPrior;
118 expectedPrior = expected;
119 uint32 receivedDelta = getObservedPacketCount() -
121 receivedPrior = getObservedPacketCount();
122 uint32 lostDelta = expectedDelta - receivedDelta;
123 if ( expectedDelta == 0 || lostDelta <= 0 )
126 setFractionLost((lostDelta<<8) / expectedDelta );
131 tpport_t dataPort, tpport_t controlPort)
147 if ( NULL == senderInfo )
148 senderInfo =
reinterpret_cast<unsigned char*
>
157 if ( NULL == receiverInfo )
158 receiverInfo =
reinterpret_cast<unsigned char*
>
166 #define HASH(a) ((a + (a >> 8)) % MembershipBookkeeping::sourceBucketsNum)
186 #ifdef CCXX_EXCEPTIONS
190 #ifdef CCXX_EXCEPTIONS
195 #ifdef CCXX_EXCEPTIONS
199 #ifdef CCXX_EXCEPTIONS
210 while ( sl != NULL ) {
214 }
else if ( ssrc < sl->getSource()->getID() ) {
228 uint32 hashing =
HASH(ssrc);
233 if ( NULL == result ) {
238 while ( NULL != result ) {
261 if ( NULL == result ) {
301 if ( s->getSource()->getID() == ssrc ) {
306 s->getPrev()->setNext(s->getNext());
308 s->getNext()->setPrev(s->getPrev());
310 if ( s->getSource()->isSender() )
315 }
else if ( s->getSource()->getID() > ssrc ) {
static const uint32 SEQNUMMOD
void setReceiverInfo(unsigned char *ri)
Synchronization source in an RTP session.
SyncSourceLink * getNextCollis()
Get the link object for the next RTP source in the hash table entry collision list.
void setPrevConflict(InetAddress &addr, tpport_t dataPort, tpport_t controlPort)
Get conflicting address.
bool isRegistered(uint32 ssrc)
Returns whether there is already a synchronizacion source with "ssrc" SSRC identifier.
unsigned char * receiverInfo
void setSenderInfo(unsigned char *si)
ConflictingTransportAddress * prevConflict
void increaseMembersCount()
Participant objects modification methods.
void setNextCollis(SyncSourceLink *ns)
Declaration of ccRTP internal stuff.
SyncSourceLink ** sourceLinks
Synchronization Source internal handler within the incoming packets queue.
members and senders accounting
SyncSource * getSource()
Get the synchronization source object this link objet holds information for.
To track addresses of sources conflicting with the local one.
void endMembers()
Purge all RTPSource structures, the hash table and the list of sources.
Struct for the sender info block in a SR (sender report) RTCP packet.
void setNext(SyncSourceLink *ns)
void computeStats()
Compute cumulative packet lost and fraction of packets lost during the last reporting interval...
static const size_t defaultMembersHashSize
bool BYESource(uint32 ssrc)
Mark the source identified by ssrc as having sent a BYE packet.
Generic RTCP control queues.
unsigned char * senderInfo
void recordInsertion(const IncomingRTPPktLink &pl)
Record the insertion of an RTP packet from this source into the scheduled reception queue...
SyncSourceLink * getSourceBySSRC(uint32 ssrc, bool &created)
Get the description of a source by its ssrc identifier.
void decreaseSendersCount()
void decreaseMembersCount()
Incoming RTP data packets control structure within the incoming packet queue class.
SyncSource objects modification methods.
~SyncSourceLink()
Note it deletes the source.
static const uint32 SEQNUMMOD
Struct for the data contained in a receiver info block.
MembershipBookkeeping(uint32 initialSize=defaultMembersHashSize)
The initial size is a hint to allocate the resources needed in order to keep the members' identifiers...
bool removeSource(uint32 ssrc)
Remove the description of the source identified by ssrc