37 #ifndef RTCPSRPACKET_H 39 #define RTCPSRPACKET_H 41 #include "rtpconfig.h" 45 #ifdef RTP_SUPPORT_NETINET_IN 46 #include <netinet/in.h> 47 #endif // RTP_SUPPORT_NETINET_IN 52 class RTCPCompoundPacket;
67 uint32_t GetSenderSSRC()
const;
73 uint32_t GetRTPTimestamp()
const;
76 uint32_t GetSenderPacketCount()
const;
79 uint32_t GetSenderOctetCount()
const;
82 int GetReceptionReportCount()
const;
88 uint32_t GetSSRC(
int index)
const;
94 uint8_t GetFractionLost(
int index)
const;
100 int32_t GetLostPacketCount(
int index)
const;
106 uint32_t GetExtendedHighestSequenceNumber(
int index)
const;
112 uint32_t GetJitter(
int index)
const;
118 uint32_t GetLSR(
int index)
const;
124 uint32_t GetDLSR(
int index)
const;
130 RTCPReceiverReport *GotoReport(
int index)
const;
138 uint32_t *ssrcptr = (uint32_t *)(data+
sizeof(RTCPCommonHeader));
139 return ntohl(*ssrcptr);
147 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
148 return RTPNTPTime(ntohl(sr->ntptime_msw),ntohl(sr->ntptime_lsw));
155 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
156 return ntohl(sr->rtptimestamp);
163 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
164 return ntohl(sr->packetcount);
171 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
172 return ntohl(sr->octetcount);
179 RTCPCommonHeader *hdr = (RTCPCommonHeader *)data;
180 return ((
int)hdr->count);
183 inline RTCPReceiverReport *RTCPSRPacket::GotoReport(
int index)
const 185 RTCPReceiverReport *r = (RTCPReceiverReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t)+
sizeof(RTCPSenderReport)+index*
sizeof(RTCPReceiverReport));
193 RTCPReceiverReport *r = GotoReport(index);
194 return ntohl(r->ssrc);
201 RTCPReceiverReport *r = GotoReport(index);
202 return r->fractionlost;
209 RTCPReceiverReport *r = GotoReport(index);
210 uint32_t count = ((uint32_t)r->packetslost[2])|(((uint32_t)r->packetslost[1])<<8)|(((uint32_t)r->packetslost[0])<<16);
211 if ((count&0x00800000) != 0)
213 int32_t *count2 = (int32_t *)(&count);
221 RTCPReceiverReport *r = GotoReport(index);
222 return ntohl(r->exthighseqnr);
229 RTCPReceiverReport *r = GotoReport(index);
230 return ntohl(r->jitter);
237 RTCPReceiverReport *r = GotoReport(index);
238 return ntohl(r->lsr);
245 RTCPReceiverReport *r = GotoReport(index);
246 return ntohl(r->dlsr);
251 #endif // RTCPSRPACKET_H uint32_t GetRTPTimestamp() const
Returns the RTP timestamp contained in the sender report.
Definition: rtcpsrpacket.h:151
uint32_t GetExtendedHighestSequenceNumber(int index) const
Returns the extended highest sequence number of the reception report block described by index which m...
Definition: rtcpsrpacket.h:217
Describes an RTCP sender report packet.
Definition: rtcpsrpacket.h:55
RTPNTPTime GetNTPTimestamp() const
Returns the NTP timestamp contained in the sender report.
Definition: rtcpsrpacket.h:142
This is a simple wrapper for the most significant word (MSW) and least significant word (LSW) of an N...
Definition: rtptimeutilities.h:65
uint32_t GetSSRC(int index) const
Returns the SSRC of the reception report block described by index which may have a value from 0 to Ge...
Definition: rtcpsrpacket.h:189
uint8_t GetFractionLost(int index) const
Returns the `fraction lost' field of the reception report described by index which may have a value f...
Definition: rtcpsrpacket.h:197
uint32_t GetLSR(int index) const
Returns the LSR field of the reception report block described by index which may have a value from 0 ...
Definition: rtcpsrpacket.h:233
uint32_t GetDLSR(int index) const
Returns the DLSR field of the reception report block described by index which may have a value from 0...
Definition: rtcpsrpacket.h:241
uint32_t GetJitter(int index) const
Returns the jitter field of the reception report block described by index which may have a value from...
Definition: rtcpsrpacket.h:225
uint32_t GetSenderOctetCount() const
Returns the sender's octet count contained in the sender report.
Definition: rtcpsrpacket.h:167
int GetReceptionReportCount() const
Returns the number of reception report blocks present in this packet.
Definition: rtcpsrpacket.h:175
uint32_t GetSenderSSRC() const
Returns the SSRC of the participant who sent this packet.
Definition: rtcpsrpacket.h:133
Definition: rtpfaketransmitter.h:64
uint32_t GetSenderPacketCount() const
Returns the sender's packet count contained in the sender report.
Definition: rtcpsrpacket.h:159
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:50
int32_t GetLostPacketCount(int index) const
Returns the number of lost packets in the reception report block described by index which may have a ...
Definition: rtcpsrpacket.h:205