37 #ifndef RTCPSRPACKET_H
39 #define RTCPSRPACKET_H
41 #include "rtpconfig.h"
45 #if ! (defined(WIN32) || defined(_WIN32_WCE))
46 #include <netinet/in.h>
85 uint32_t
GetSSRC(
int index)
const;
115 uint32_t
GetLSR(
int index)
const;
121 uint32_t
GetDLSR(
int index)
const;
127 RTCPReceiverReport *GotoReport(
int index)
const;
135 uint32_t *ssrcptr = (uint32_t *)(data+
sizeof(RTCPCommonHeader));
136 return ntohl(*ssrcptr);
144 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
145 return RTPNTPTime(ntohl(sr->ntptime_msw),ntohl(sr->ntptime_lsw));
152 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
153 return ntohl(sr->rtptimestamp);
160 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
161 return ntohl(sr->packetcount);
168 RTCPSenderReport *sr = (RTCPSenderReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t));
169 return ntohl(sr->octetcount);
176 RTCPCommonHeader *hdr = (RTCPCommonHeader *)data;
177 return ((
int)hdr->count);
180 inline RTCPReceiverReport *RTCPSRPacket::GotoReport(
int index)
const
182 RTCPReceiverReport *r = (RTCPReceiverReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t)+
sizeof(RTCPSenderReport)+index*
sizeof(RTCPReceiverReport));
190 RTCPReceiverReport *r = GotoReport(index);
191 return ntohl(r->ssrc);
198 RTCPReceiverReport *r = GotoReport(index);
199 return r->fractionlost;
206 RTCPReceiverReport *r = GotoReport(index);
207 uint32_t count = ((uint32_t)r->packetslost[2])|(((uint32_t)r->packetslost[1])<<8)|(((uint32_t)r->packetslost[0])<<16);
208 if ((count&0x00800000) != 0)
210 int32_t *count2 = (int32_t *)(&count);
218 RTCPReceiverReport *r = GotoReport(index);
219 return ntohl(r->exthighseqnr);
226 RTCPReceiverReport *r = GotoReport(index);
227 return ntohl(r->jitter);
234 RTCPReceiverReport *r = GotoReport(index);
235 return ntohl(r->lsr);
242 RTCPReceiverReport *r = GotoReport(index);
243 return ntohl(r->dlsr);
246 #endif // RTCPSRPACKET_H
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:202
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:214
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:230
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:238
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:222
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:47
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:194
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:50
uint32_t GetSenderOctetCount() const
Returns the sender's octet count contained in the sender report.
Definition: rtcpsrpacket.h:164
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:186
RTPNTPTime GetNTPTimestamp() const
Returns the NTP timestamp contained in the sender report.
Definition: rtcpsrpacket.h:139
int GetReceptionReportCount() const
Returns the number of reception report blocks present in this packet.
Definition: rtcpsrpacket.h:172
uint32_t GetSenderSSRC() const
Returns the SSRC of the participant who sent this packet.
Definition: rtcpsrpacket.h:130
uint32_t GetRTPTimestamp() const
Returns the RTP timestamp contained in the sender report.
Definition: rtcpsrpacket.h:148
Describes an RTCP sender report packet.
Definition: rtcpsrpacket.h:52
RTCPSRPacket(uint8_t *data, size_t datalength)
Creates an instance based on the data in data with length datalen.
uint32_t GetSenderPacketCount() const
Returns the sender's packet count contained in the sender report.
Definition: rtcpsrpacket.h:156
This is a simple wrapper for the most significant word (MSW) and least significant word (LSW) of an N...
Definition: rtptimeutilities.h:58