41 #include "rtpconfig.h"
47 #define RTPSOURCES_HASHSIZE 8317
52 class JRTPLIB_IMPORTEXPORT RTPSources_GetHashIndex
55 static int GetIndex(
const uint32_t &ssrc) {
return ssrc%RTPSOURCES_HASHSIZE; }
61 class RTPInternalSourceData;
74 class JRTPLIB_IMPORTEXPORT
RTPSources :
public RTPMemoryObject
91 #ifdef RTP_SUPPORT_PROBATION
94 #endif // RTP_SUPPORT_PROBATION
97 int CreateOwnSSRC(uint32_t ssrc);
106 void SentRTPPacket();
143 int ProcessRTCPSenderInfo(uint32_t ssrc,
const RTPNTPTime &ntptime,uint32_t rtptime,
144 uint32_t packetcount,uint32_t octetcount,
const RTPTime &receivetime,
152 int ProcessRTCPReportBlock(uint32_t ssrc,uint8_t fractionlost,int32_t lostpackets,
153 uint32_t exthighseqnr,uint32_t jitter,uint32_t lsr,
162 const void *itemdata,
const RTPTime &receivetime,
const RTPAddress *senderaddress);
163 #ifdef RTP_SUPPORT_SDESPRIV
169 int ProcessSDESPrivateItem(uint32_t ssrc,
size_t prefixlen,
const void *prefixdata,
170 size_t valuelen,
const void *valuedata,
const RTPTime &receivetime,
172 #endif //RTP_SUPPORT_SDESPRIV
178 int ProcessBYE(uint32_t ssrc,
size_t reasonlength,
const void *reasondata,
const RTPTime &receivetime,
190 int UpdateReceiveTime(uint32_t ssrc,
const RTPTime &receivetime,
const RTPAddress *senderaddress);
196 bool GotoFirstSource();
202 bool GotoNextSource();
208 bool GotoPreviousSource();
216 bool GotoFirstSourceWithData();
224 bool GotoNextSourceWithData();
232 bool GotoPreviousSourceWithData();
246 bool GotEntry(uint32_t ssrc);
259 void SenderTimeout(
const RTPTime &curtime,
const RTPTime &timeoutdelay);
264 void BYETimeout(
const RTPTime &curtime,
const RTPTime &timeoutdelay);
269 void NoteTimeout(
const RTPTime &curtime,
const RTPTime &timeoutdelay);
275 void MultipleTimeouts(
const RTPTime &curtime,
const RTPTime &sendertimeout,
289 void SafeCountTotal();
290 void SafeCountSenders();
291 void SafeCountActive();
310 const uint8_t *cname,
size_t cnamelength) { }
344 void ClearSourceList();
345 int ObtainSourceDataInstance(uint32_t ssrc,RTPInternalSourceData **srcdat,
bool *created);
346 int GetRTCPSourceData(uint32_t ssrc,
const RTPAddress *senderaddress,RTPInternalSourceData **srcdat,
bool *newsource);
347 bool CheckCollision(RTPInternalSourceData *srcdat,
const RTPAddress *senderaddress,
bool isrtp);
349 RTPKeyHashTable<const uint32_t,RTPInternalSourceData*,RTPSources_GetHashIndex,RTPSOURCES_HASHSIZE> sourcelist;
355 #ifdef RTP_SUPPORT_PROBATION
356 ProbationType probationtype;
357 #endif // RTP_SUPPORT_PROBATION
359 RTPInternalSourceData *owndata;
364 #endif // RTPSOURCES_H
Describes an RTCP APP packet.
Definition: rtcpapppacket.h:54
This class is used by the transmission component to store the incoming RTP and RTCP data in...
Definition: rtprawpacket.h:51
int GetSenderCount() const
Returns the number of participants which are marked as a sender.
Definition: rtpsources.h:280
virtual void OnRemoveSource(RTPSourceData *srcdat)
Is called when the entry srcdat is about to be deleted from the source table.
Definition: rtpsources.h:316
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:53
void SetProbationType(ProbationType probtype)
Changes the current probation type.
Definition: rtpsources.h:93
virtual void OnRTPPacket(RTPPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTP packet is about to be processed.
Definition: rtpsources.h:295
int GetTotalCount() const
Returns the total number of entries in the source table.
Definition: rtpsources.h:283
virtual void OnTimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed out.
Definition: rtpsources.h:319
virtual void OnUnknownPacketType(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an unknown RTCP packet type was detected.
Definition: rtpsources.h:334
This is a simple wrapper for the most significant word (MSW) and least significant word (LSW) of an N...
Definition: rtptimeutilities.h:61
ProbationType
Type of probation to use for new sources.
Definition: rtpsources.h:78
This class is an abstract class which is used to specify destinations, multicast groups etc...
Definition: rtpaddress.h:50
virtual void OnNewSource(RTPSourceData *srcdat)
Is called when a new entry srcdat is added to the source table.
Definition: rtpsources.h:313
ItemType
Identifies the type of an SDES item.
Definition: rtcpsdespacket.h:59
Represents a table in which information about the participating sources is kept.
Definition: rtpsources.h:74
int GetActiveMemberCount() const
Returns the number of members which have been validated and which haven't sent a BYE packet yet...
Definition: rtpsources.h:286
virtual void OnCNAMECollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, const uint8_t *cname, size_t cnamelength)
Is called when another CNAME was received than the one already present for source srcdat...
Definition: rtpsources.h:309
Describes an entry in the RTPSources source table.
Definition: rtpsourcedata.h:166
Discard incoming RTP packets originating from a source that's on probation.
Definition: rtpsources.h:81
RTPSourceData * GetOwnSourceInfo()
If present, it returns the RTPSourceData instance of the entry which was created by CreateOwnSSRC...
Definition: rtpsources.h:249
Abstract class from which actual transmission components should be derived.
Definition: rtptransmitter.h:61
virtual void OnBYEPacket(RTPSourceData *srcdat)
Is called when a BYE packet has been processed for source srcdat.
Definition: rtpsources.h:325
virtual void OnSSRCCollision(RTPSourceData *srcdat, const RTPAddress *senderaddress, bool isrtp)
Is called when an SSRC collision was detected.
Definition: rtpsources.h:306
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:80
A memory manager.
Definition: rtpmemorymanager.h:147
virtual void OnAPPPacket(RTCPAPPPacket *apppacket, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTCP APP packet apppacket has been received at time receivetime from address sender...
Definition: rtpsources.h:330
Represents an RTP Packet.
Definition: rtppacket.h:56
Don't use the probation algorithm; accept RTP packets immediately.
Definition: rtpsources.h:80
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:50
virtual void OnBYETimeout(RTPSourceData *srcdat)
Is called when participant srcdat is timed after having sent a BYE packet.
Definition: rtpsources.h:322
virtual void OnUnknownPacketFormat(RTCPPacket *rtcppack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an unknown packet format for a known packet type was detected.
Definition: rtpsources.h:338
virtual void OnNoteTimeout(RTPSourceData *srcdat)
Is called when the SDES NOTE item for source srcdat has been timed out.
Definition: rtpsources.h:342
virtual void OnRTCPCompoundPacket(RTCPCompoundPacket *pack, const RTPTime &receivetime, const RTPAddress *senderaddress)
Is called when an RTCP compound packet is about to be processed.
Definition: rtpsources.h:298