37 #ifndef RTPSOURCEDATA_H 39 #define RTPSOURCEDATA_H 41 #include "rtpconfig.h" 52 class RTCPSenderReportInfo
55 RTCPSenderReportInfo():ntptimestamp(0,0),receivetime(0,0) { hasinfo =
false; rtptimestamp = 0; packetcount = 0; bytecount = 0; }
56 void Set(
const RTPNTPTime &ntptime,uint32_t rtptime,uint32_t pcount,
57 uint32_t bcount,
const RTPTime &rcvtime) { ntptimestamp = ntptime; rtptimestamp = rtptime; packetcount = pcount; bytecount = bcount; receivetime = rcvtime; hasinfo =
true; }
59 bool HasInfo()
const {
return hasinfo; }
60 RTPNTPTime GetNTPTimestamp()
const {
return ntptimestamp; }
61 uint32_t GetRTPTimestamp()
const {
return rtptimestamp; }
62 uint32_t GetPacketCount()
const {
return packetcount; }
63 uint32_t GetByteCount()
const {
return bytecount; }
64 RTPTime GetReceiveTime()
const {
return receivetime; }
68 uint32_t rtptimestamp;
74 class RTCPReceiverReportInfo
77 RTCPReceiverReportInfo():receivetime(0,0) { hasinfo =
false; fractionlost = 0; packetslost = 0; exthighseqnr = 0; jitter = 0; lsr = 0; dlsr = 0; }
78 void Set(uint8_t fraclost,int32_t plost,uint32_t exthigh,
79 uint32_t jit,uint32_t l,uint32_t dl,
const RTPTime &rcvtime) { fractionlost = ((double)fraclost)/256.0; packetslost = plost; exthighseqnr = exthigh; jitter = jit; lsr = l; dlsr = dl; receivetime = rcvtime; hasinfo =
true; }
81 bool HasInfo()
const {
return hasinfo; }
82 double GetFractionLost()
const {
return fractionlost; }
83 int32_t GetPacketsLost()
const {
return packetslost; }
84 uint32_t GetExtendedHighestSequenceNumber()
const {
return exthighseqnr; }
85 uint32_t GetJitter()
const {
return jitter; }
86 uint32_t GetLastSRTimestamp()
const {
return lsr; }
87 uint32_t GetDelaySinceLastSR()
const {
return dlsr; }
88 RTPTime GetReceiveTime()
const {
return receivetime; }
93 uint32_t exthighseqnr;
104 void ProcessPacket(
RTPPacket *pack,
const RTPTime &receivetime,
double tsunit,
bool ownpacket,
bool *accept,
bool applyprobation,
bool *onprobation);
106 bool HasSentData()
const {
return sentdata; }
107 uint32_t GetNumPacketsReceived()
const {
return packetsreceived; }
108 uint32_t GetBaseSequenceNumber()
const {
return baseseqnr; }
109 uint32_t GetExtendedHighestSequenceNumber()
const {
return exthighseqnr; }
110 uint32_t GetJitter()
const {
return jitter; }
112 int32_t GetNumPacketsReceivedInInterval()
const {
return numnewpackets; }
113 uint32_t GetSavedExtendedSequenceNumber()
const {
return savedextseqnr; }
114 void StartNewInterval() { numnewpackets = 0; savedextseqnr = exthighseqnr; }
116 void SetLastMessageTime(
const RTPTime &t) { lastmsgtime = t; }
117 RTPTime GetLastMessageTime()
const {
return lastmsgtime; }
118 void SetLastRTPPacketTime(
const RTPTime &t) { lastrtptime = t; }
119 RTPTime GetLastRTPPacketTime()
const {
return lastrtptime; }
121 void SetLastNoteTime(
const RTPTime &t) { lastnotetime = t; }
122 RTPTime GetLastNoteTime()
const {
return lastnotetime; }
125 uint32_t packetsreceived;
128 uint32_t exthighseqnr,prevexthighseqnr;
129 uint32_t jitter,prevtimestamp;
135 uint32_t numnewpackets;
136 uint32_t savedextseqnr;
137 #ifdef RTP_SUPPORT_PROBATION 141 #endif // RTP_SUPPORT_PROBATION 144 inline RTPSourceStats::RTPSourceStats():prevpacktime(0,0),lastmsgtime(0,0),lastrtptime(0,0),lastnotetime(0,0)
150 prevexthighseqnr = 0;
157 #ifdef RTP_SUPPORT_PROBATION 160 #endif // RTP_SUPPORT_PROBATION 177 bool HasData()
const {
if (!validated)
return false;
return packetlist.empty()?
false:
true; }
200 bool IsActive()
const {
if (!validated)
return false;
if (receivedbye)
return false;
return true; }
243 uint8_t *
GetBYEReason(
size_t *len)
const { *len = byereasonlen;
return byereason; }
367 double INF_GetEstimatedTimestampUnit()
const;
381 RTPTime INF_GetRoundtripTime()
const;
390 uint8_t *
SDES_GetName(
size_t *len)
const {
return SDESinf.GetName(len); }
402 uint8_t *
SDES_GetTool(
size_t *len)
const {
return SDESinf.GetTool(len); }
405 uint8_t *
SDES_GetNote(
size_t *len)
const {
return SDESinf.GetNote(len); }
407 #ifdef RTP_SUPPORT_SDESPRIV 414 bool SDES_GetNextPrivateValue(uint8_t **prefix,
size_t *prefixlen,uint8_t **value,
size_t *valuelen) {
return SDESinf.GetNextPrivateValue(prefix,prefixlen,value,valuelen); }
420 bool SDES_GetPrivateValue(uint8_t *prefix,
size_t prefixlen,uint8_t **value,
size_t *valuelen)
const {
return SDESinf.GetPrivateValue(prefix,prefixlen,value,valuelen); }
421 #endif // RTP_SUPPORT_SDESPRIV 427 std::list<RTPPacket *> packetlist;
432 double timestampunit;
435 bool processedinrtcp;
438 RTCPSenderReportInfo SRinf,SRprevinf;
439 RTCPReceiverReportInfo RRinf,RRprevinf;
440 RTPSourceStats stats;
443 bool isrtpaddrset,isrtcpaddrset;
458 if (packetlist.empty())
460 p = *(packetlist.begin());
461 packetlist.pop_front();
467 std::list<RTPPacket *>::const_iterator it;
469 for (it = packetlist.begin() ; it != packetlist.end() ; ++it)
470 RTPDelete(*it,GetMemoryManager());
473 #endif // RTPSOURCEDATA_H uint32_t INF_GetNumPacketsReceivedInInterval() const
Returns the number of packets received since a new interval was started with INF_StartNewInterval.
Definition: rtpsourcedata.h:370
uint8_t * SDES_GetTool(size_t *len) const
Returns a pointer to the SDES tool item of this participant and stores its length in len...
Definition: rtpsourcedata.h:402
RTPTime SR_GetReceiveTime() const
Returns the time at which the last sender report was received.
Definition: rtpsourcedata.h:275
void INF_StartNewInterval()
Starts a new interval to count received packets in; this also stores the current extended highest seq...
Definition: rtpsourcedata.h:378
bool IsValidated() const
Returns true if the participant is validated, which is the case if a number of consecutive RTP packet...
Definition: rtpsourcedata.h:197
Represents an RTP Packet.
Definition: rtppacket.h:53
bool SR_HasInfo() const
Returns true if an RTCP sender report has been received from this participant.
Definition: rtpsourcedata.h:260
uint32_t GetSSRC() const
Returns the SSRC identifier for this member.
Definition: rtpsourcedata.h:180
uint32_t INF_GetJitter() const
Returns the current jitter value for this participant.
Definition: rtpsourcedata.h:358
bool SDES_GetNextPrivateValue(uint8_t **prefix, size_t *prefixlen, uint8_t **value, size_t *valuelen)
If available, returns true and stores the next SDES private item prefix in prefix and its length in p...
Definition: rtpsourcedata.h:414
bool INF_HasSentData() const
Returns true if validated RTP packets have been received from this participant.
Definition: rtpsourcedata.h:346
The class RTCPSDESInfo is a container for RTCP SDES information.
Definition: rtcpsdesinfo.h:50
const RTPAddress * GetRTPDataAddress() const
Returns the address from which this participant's RTP packets originate.
Definition: rtpsourcedata.h:227
uint32_t INF_GetBaseSequenceNumber() const
Returns the base sequence number of this participant.
Definition: rtpsourcedata.h:352
A memory manager.
Definition: rtpmemorymanager.h:144
int32_t INF_GetNumPacketsReceived() const
Returns the total number of received packets from this participant.
Definition: rtpsourcedata.h:349
RTPTime INF_GetLastRTPPacketTime() const
Returns the time at which the last RTP packet was received.
Definition: rtpsourcedata.h:364
This class is used to specify wallclock time, delay intervals etc.
Definition: rtptimeutilities.h:77
double RR_Prev_GetFractionLost() const
Returns the fraction lost value from the second to last report.
Definition: rtpsourcedata.h:325
uint8_t * GetBYEReason(size_t *len) const
Returns the reason for leaving contained in the BYE packet of this participant.
Definition: rtpsourcedata.h:243
void SDES_GotoFirstPrivateValue()
Starts the iteration over the stored SDES private item prefixes and their associated values...
Definition: rtpsourcedata.h:409
bool SDES_GetPrivateValue(uint8_t *prefix, size_t prefixlen, uint8_t **value, size_t *valuelen) const
Looks for the entry which corresponds to the SDES private item prefix prefix with length prefixlen; i...
Definition: rtpsourcedata.h:420
uint32_t RR_Prev_GetJitter() const
Returns the jitter value from the second to last report.
Definition: rtpsourcedata.h:334
uint32_t RR_Prev_GetLastSRTimestamp() const
Returns the LSR value from the second to last report.
Definition: rtpsourcedata.h:337
bool IsActive() const
Returns true if the source was validated and had not yet sent a BYE packet.
Definition: rtpsourcedata.h:200
void SetProcessedInRTCP(bool v)
This function is used by the RTCPPacketBuilder class to mark whether this participant's information h...
Definition: rtpsourcedata.h:205
double RR_GetFractionLost() const
Returns the fraction lost value from the last report.
Definition: rtpsourcedata.h:299
bool IsRTCPAddressSet() const
Returns true if the address from which this participant's RTCP packets originate has already been set...
Definition: rtpsourcedata.h:220
uint32_t INF_GetExtendedHighestSequenceNumber() const
Returns the extended highest sequence number received from this participant.
Definition: rtpsourcedata.h:355
RTPTime RR_GetReceiveTime() const
Returns the time at which the last report was received.
Definition: rtpsourcedata.h:317
uint8_t * SDES_GetEMail(size_t *len) const
Returns a pointer to the SDES e-mail item of this participant and stores its length in len...
Definition: rtpsourcedata.h:393
uint32_t RR_GetExtendedHighestSequenceNumber() const
Returns the extended highest sequence number contained in the last report.
Definition: rtpsourcedata.h:305
const RTPAddress * GetRTCPDataAddress() const
Returns the address from which this participant's RTCP packets originate.
Definition: rtpsourcedata.h:234
ProbationType
Type of probation to use for new sources.
Definition: rtpsources.h:75
RTPNTPTime SR_Prev_GetNTPTimestamp() const
Returns the NTP timestamp contained in the second to last sender report.
Definition: rtpsourcedata.h:281
uint32_t SR_Prev_GetByteCount() const
Returns the octet count contained in the second to last sender report.
Definition: rtpsourcedata.h:290
RTPTime INF_GetLastMessageTime() const
Returns the time at which something was last heard from this member.
Definition: rtpsourcedata.h:361
uint32_t RR_Prev_GetExtendedHighestSequenceNumber() const
Returns the extended highest sequence number contained in the second to last report.
Definition: rtpsourcedata.h:331
bool IsOwnSSRC() const
Returns true if the participant was added using the RTPSources member function CreateOwnSSRC and retu...
Definition: rtpsourcedata.h:185
bool IsCSRC() const
Returns true if the source identifier is actually a CSRC from an RTP packet.
Definition: rtpsourcedata.h:188
bool HasData() const
Returns true if there are RTP packets which can be extracted.
Definition: rtpsourcedata.h:177
uint32_t INF_GetSavedExtendedSequenceNumber() const
Returns the extended sequence number which was stored by the INF_StartNewInterval call...
Definition: rtpsourcedata.h:373
uint8_t * SDES_GetName(size_t *len) const
Returns a pointer to the SDES name item of this participant and stores its length in len...
Definition: rtpsourcedata.h:390
double GetTimestampUnit() const
Returns the timestamp unit used for this participant.
Definition: rtpsourcedata.h:257
uint32_t SR_GetRTPTimestamp() const
Returns the RTP timestamp contained in the last sender report.
Definition: rtpsourcedata.h:266
RTPTime SR_Prev_GetReceiveTime() const
Returns the time at which the second to last sender report was received.
Definition: rtpsourcedata.h:293
uint32_t RR_GetLastSRTimestamp() const
Returns the LSR value from the last report.
Definition: rtpsourcedata.h:311
uint32_t RR_Prev_GetDelaySinceLastSR() const
Returns the DLSR value from the second to last report.
Definition: rtpsourcedata.h:340
This class is an abstract class which is used to specify destinations, multicast groups etc...
Definition: rtpaddress.h:47
uint8_t * SDES_GetCNAME(size_t *len) const
Returns a pointer to the SDES CNAME item of this participant and stores its length in len...
Definition: rtpsourcedata.h:387
bool IsProcessedInRTCP() const
This function is used by the RTCPPacketBuilder class and returns whether this participant has been pr...
Definition: rtpsourcedata.h:210
void FlushPackets()
Clears the participant's RTP packet list.
Definition: rtpsourcedata.h:465
int32_t RR_GetPacketsLost() const
Returns the number of lost packets contained in the last report.
Definition: rtpsourcedata.h:302
RTPNTPTime SR_GetNTPTimestamp() const
Returns the NTP timestamp contained in the last sender report.
Definition: rtpsourcedata.h:263
bool RR_Prev_HasInfo() const
Returns true if this participant sent more than one receiver report with information about the recept...
Definition: rtpsourcedata.h:322
void SetTimestampUnit(double tsu)
Sets the value for the timestamp unit to be used in jitter calculations for data received from this p...
Definition: rtpsourcedata.h:254
bool IsRTPAddressSet() const
Returns true if the address from which this participant's RTP packets originate has already been set...
Definition: rtpsourcedata.h:215
int32_t RR_Prev_GetPacketsLost() const
Returns the number of lost packets contained in the second to last report.
Definition: rtpsourcedata.h:328
bool ReceivedBYE() const
Returns true if we received a BYE message for this participant and false otherwise.
Definition: rtpsourcedata.h:237
RTPTime GetBYETime() const
Returns the time at which the BYE packet was received.
Definition: rtpsourcedata.h:246
uint32_t SR_Prev_GetPacketCount() const
Returns the packet count contained in the second to last sender report.
Definition: rtpsourcedata.h:287
uint32_t RR_GetDelaySinceLastSR() const
Returns the DLSR value from the last report.
Definition: rtpsourcedata.h:314
RTPTime RR_Prev_GetReceiveTime() const
Returns the time at which the second to last report was received.
Definition: rtpsourcedata.h:343
uint32_t RR_GetJitter() const
Returns the jitter value from the last report.
Definition: rtpsourcedata.h:308
bool RR_HasInfo() const
Returns true if this participant sent a receiver report with information about the reception of our d...
Definition: rtpsourcedata.h:296
uint8_t * SDES_GetNote(size_t *len) const
Returns a pointer to the SDES note item of this participant and stores its length in len...
Definition: rtpsourcedata.h:405
bool SR_Prev_HasInfo() const
Returns true if more than one RTCP sender report has been received.
Definition: rtpsourcedata.h:278
uint32_t SR_Prev_GetRTPTimestamp() const
Returns the RTP timestamp contained in the second to last sender report.
Definition: rtpsourcedata.h:284
uint8_t * SDES_GetPhone(size_t *len) const
Returns a pointer to the SDES phone item of this participant and stores its length in len...
Definition: rtpsourcedata.h:396
uint8_t * SDES_GetLocation(size_t *len) const
Returns a pointer to the SDES location item of this participant and stores its length in len...
Definition: rtpsourcedata.h:399
RTPPacket * GetNextPacket()
Extracts the first packet of this participants RTP packet queue.
Definition: rtpsourcedata.h:451
uint32_t SR_GetPacketCount() const
Returns the packet count contained in the last sender report.
Definition: rtpsourcedata.h:269
bool IsSender() const
Returns true if this member is marked as a sender and false if not.
Definition: rtpsourcedata.h:191
This is a simple wrapper for the most significant word (MSW) and least significant word (LSW) of an N...
Definition: rtptimeutilities.h:58
Describes an entry in the RTPSources source table.
Definition: rtpsourcedata.h:164
uint32_t SR_GetByteCount() const
Returns the octet count contained in the last sender report.
Definition: rtpsourcedata.h:272
RTPTime INF_GetLastSDESNoteTime() const
Returns the time at which the last SDES NOTE item was received.
Definition: rtpsourcedata.h:384