#include <RTCPPacket.h>
Inheritance diagram for RTCPPacket:
Public Types | |
enum | RTCP_PACKET_TYPE { RTCP_PT_UNDEF = 0, RTCP_PT_SR = 200, RTCP_PT_RR = 201, RTCP_PT_SDES = 202, RTCP_PT_BYE = 203 } |
Public Member Functions | |
RTCPPacket (const char *name=NULL) | |
RTCPPacket (const RTCPPacket &rtcpPacket) | |
virtual | ~RTCPPacket () |
RTCPPacket & | operator= (const RTCPPacket &rtcpPacket) |
virtual const char * | className () const |
virtual cObject * | dup () const |
virtual std::string | info () |
virtual void | writeContents (std::ostream &os) const |
virtual int | version () |
virtual int | padding () |
virtual int | count () |
virtual RTCP_PACKET_TYPE | packetType () |
virtual int | rtcpLength () const |
Protected Attributes | |
int | _version |
int | _padding |
int | _count |
RTCP_PACKET_TYPE | _packetType |
|
The values for the packet type field in the rtcp header as defined in the rfc.
00055 { 00056 RTCP_PT_UNDEF = 0, 00057 RTCP_PT_SR = 200, 00058 RTCP_PT_RR = 201, 00059 RTCP_PT_SDES = 202, 00060 RTCP_PT_BYE = 203 00061 };
|
|
Default constructor. 00039 : cPacket(name) { 00040 // initialize variables 00041 _version = 2; 00042 _padding = 0; 00043 _count = 0; 00044 _packetType = RTCP_PT_UNDEF; 00045 // rtcpLength can be calculated with cPacket::length() 00046 00047 // RTCP header length size is 4 bytes 00048 // not all rtcp packets (in particular RTCPSDESPacket) have 00049 // the ssrc identifier stored in the header 00050 setLength(4); 00051 };
|
|
Copy constructor. 00054 : cPacket() { 00055 setName(rtcpPacket.name()); 00056 operator=(rtcpPacket); 00057 };
|
|
Destructor. 00060 { 00061 };
|
|
Return the class name "RTCPPacket". Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, RTCPSDESPacket, and RTCPByePacket. 00075 { 00076 return "RTCPPacket"; 00077 };
|
|
Returns the value of the count field in the rtcp header. Depending on the type of rtcp packet it stands for number of receiver reports or number of sdes chunks contained in this packet. 00112 { 00113 return _count; 00114 };
|
|
Duplicates the RTCPPacket by calling the copy constructor. Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, RTCPSDESPacket, and RTCPByePacket. 00080 { 00081 return new RTCPPacket(*this); 00082 };
|
|
Writes a short info about this RTCPPacket into the given buffer. Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, and RTCPSDESPacket. 00085 { 00086 std::stringstream out; 00087 out << "RTCPPacket.packetType=" << _packetType; 00088 return out.str(); 00089 };
|
|
Assignment operator. 00064 { 00065 cPacket::operator=(rtcpPacket); 00066 setName(rtcpPacket.name()); 00067 _version = rtcpPacket._version; 00068 _padding = rtcpPacket._padding; 00069 _count = rtcpPacket._count; 00070 _packetType = rtcpPacket._packetType; 00071 return *this; 00072 };
|
|
Returns the packet type of this rtcp packet. 00117 { 00118 return _packetType; 00119 };
|
|
1 if padding exists, 0 otherwise. In this implementation only 0 is used. 00107 { 00108 return _padding; 00109 };
|
|
Returns the value of the field length in the rtcp header. The value isn't stored because it can be calculated with the length() method inherited from cPacket. 00122 { 00123 // rtcpLength is the header field length 00124 // of an rtcp packet 00125 // in 32 bit words minus one 00126 return (int)(length() / 4) - 1; 00127 };
|
|
Returns the rtp version of the rtcp packet. It's always 2. 00102 { 00103 return _version; 00104 };
|
|
Writes a detailed report about this RTCPPacket into the given stream. Reimplemented in RTCPReceiverReportPacket, RTCPSenderReportPacket, and RTCPSDESPacket. 00092 { 00093 os << "RTCPPacket:" << endl; 00094 os << " version = " << _version << endl; 00095 os << " padding = " << _padding << endl; 00096 os << " count = " << _count << endl; 00097 os << " packetType = " << _packetType << endl; 00098 os << " rtcpLength = " << rtcpLength() << endl; 00099 };
|
|
Depending on the packet type, here is stored how many receiver reports or sdes chunks are contained in the packet. Values from 0 to 31 are allowed. |
|
The packet type of the rtcp packet. |
|
Set to 1 if padding (bytes at the end of the packet to assure that the packet length in bytes is a multiple of a certain number; possibly needed for encryption) is used. In the simulation padding |
|
The rtp version used. Always 2. |