37 #ifndef RTCPRRPACKET_H
39 #define RTCPRRPACKET_H
41 #include "rtpconfig.h"
44 #if ! (defined(WIN32) || defined(_WIN32_WCE))
45 #include <netinet/in.h>
72 uint32_t
GetSSRC(
int index)
const;
102 uint32_t
GetLSR(
int index)
const;
108 uint32_t
GetDLSR(
int index)
const;
115 RTCPReceiverReport *GotoReport(
int index)
const;
123 uint32_t *ssrcptr = (uint32_t *)(data+
sizeof(RTCPCommonHeader));
124 return ntohl(*ssrcptr);
130 RTCPCommonHeader *hdr = (RTCPCommonHeader *)data;
131 return ((
int)hdr->count);
134 inline RTCPReceiverReport *RTCPRRPacket::GotoReport(
int index)
const
136 RTCPReceiverReport *r = (RTCPReceiverReport *)(data+
sizeof(RTCPCommonHeader)+
sizeof(uint32_t)+index*
sizeof(RTCPReceiverReport));
144 RTCPReceiverReport *r = GotoReport(index);
145 return ntohl(r->ssrc);
152 RTCPReceiverReport *r = GotoReport(index);
153 return r->fractionlost;
160 RTCPReceiverReport *r = GotoReport(index);
161 uint32_t count = ((uint32_t)r->packetslost[2])|(((uint32_t)r->packetslost[1])<<8)|(((uint32_t)r->packetslost[0])<<16);
162 if ((count&0x00800000) != 0)
164 int32_t *count2 = (int32_t *)(&count);
172 RTCPReceiverReport *r = GotoReport(index);
173 return ntohl(r->exthighseqnr);
180 RTCPReceiverReport *r = GotoReport(index);
181 return ntohl(r->jitter);
188 RTCPReceiverReport *r = GotoReport(index);
189 return ntohl(r->lsr);
196 RTCPReceiverReport *r = GotoReport(index);
197 return ntohl(r->dlsr);
200 #endif // RTCPRRPACKET_H
Base class for specific types of RTCP packets.
Definition: rtcppacket.h:47
Represents an RTCP compound packet.
Definition: rtcpcompoundpacket.h:50
RTCPRRPacket(uint8_t *data, size_t datalen)
Creates an instance based on the data in data with length datalen.
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: rtcprrpacket.h:184
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: rtcprrpacket.h:192
Describes an RTCP receiver report packet.
Definition: rtcprrpacket.h:51
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: rtcprrpacket.h:156
uint32_t GetSenderSSRC() const
Returns the SSRC of the participant who sent this packet.
Definition: rtcprrpacket.h:118
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: rtcprrpacket.h:140
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: rtcprrpacket.h:148
uint32_t GetExtendedHighestSequenceNumber(int index) const
Returns the extended highest sequence number of the reception report block described by index which m...
Definition: rtcprrpacket.h:168
int GetReceptionReportCount() const
Returns the number of reception report blocks present in this packet.
Definition: rtcprrpacket.h:126
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: rtcprrpacket.h:176