#include <RTCP_Packet.h>
Inheritance diagram for RTCP_Packet:


Public Member Functions | |
| RTCP_Packet (void) | |
| Constructor for outgoing RTCP packets. | |
| RTCP_Packet (char *buffer) | |
| Constructor for incoming RTCP packets. | |
| virtual | ~RTCP_Packet () |
| Destructor. | |
| void | get_packet_data (char **buffer, ACE_UINT16 &length) |
| Returns a pointer to a local buffer containing the packet. | |
| virtual unsigned int | packet_size (void)=0 |
| int | is_valid (char is_first) |
Protected Member Functions | |
| virtual void | build_packet (void)=0 |
Protected Attributes | |
| RTCP_Common_Header | chd_ |
| Header data common to all RTCP packets. | |
| char * | packet_data_ |
| Buffer to hold byte representation of the RTCP packet. | |
Definition at line 44 of file RTCP_Packet.h.
|
|
Constructor for outgoing RTCP packets.
Definition at line 7 of file RTCP_Packet.cpp. References chd_, RTCP_Common_Header::count_, RTCP_Common_Header::length_, packet_data_, RTCP_Common_Header::pad_, and RTCP_Common_Header::ver_.
|
|
|
Constructor for incoming RTCP packets.
Definition at line 16 of file RTCP_Packet.cpp. References ACE_DEBUG, ACE_NTOHS, chd_, RTCP_Common_Header::count_, RTCP_Common_Header::length_, LM_DEBUG, packet_data_, RTCP_Common_Header::pad_, RTCP_Common_Header::pt_, RTP_VERSION, and RTCP_Common_Header::ver_.
00017 {
00018 // Parse the common part of the control packet header.
00019 this->chd_.ver_ = (buffer[0] & 0xC0) >> 6;
00020
00021 if (this->chd_.ver_ != RTP_VERSION)
00022 ACE_DEBUG ((LM_DEBUG,
00023 "RTCP_Packet::RTCP_Packet version incorrect"));
00024
00025 this->chd_.pad_ = (buffer[0] & 0x20) >> 5;
00026 this->chd_.count_ = buffer[0] & 0x1F;
00027 this->chd_.pt_ = buffer[1];
00028 this->chd_.length_ = ACE_NTOHS(*(ACE_UINT16*)&buffer[2]);
00029 this->packet_data_ = 0;
00030 }
|
|
|
Destructor.
Definition at line 32 of file RTCP_Packet.cpp.
00033 {
00034 }
|
|
|
Used to create the byte representation of the RTCP packet. Defined in child class. Implemented in RTCP_BYE_Packet, RTCP_RR_Packet, RTCP_SDES_Packet, and RTCP_SR_Packet. Referenced by get_packet_data(). |
|
||||||||||||
|
Returns a pointer to a local buffer containing the packet.
Definition at line 37 of file RTCP_Packet.cpp. References build_packet(), packet_data_, and packet_size(). Referenced by TAO_AV_RTCP_Callback::send_report().
00038 {
00039 length = static_cast<ACE_UINT16> (this->packet_size());
00040
00041 // buiidPacket is defined for each child of RTCP_Packet
00042 // buildPacket creates a snapshot of the RTCP packet in the buffer pktData
00043 this->build_packet ();
00044
00045 *buffer = this->packet_data_;
00046 }
|
|
|
Checks the validity of an RTCP packet. RTCP packets can be sent together in a compound packet and is_first indicates the first packet in a compound packet Definition at line 49 of file RTCP_Packet.cpp. References chd_, RTCP_Common_Header::pad_, RTCP_Common_Header::pt_, RTCP_PT_RR, RTCP_PT_SR, RTP_VERSION, and RTCP_Common_Header::ver_. Referenced by TAO_AV_RTCP_Callback::receive_control_frame().
00050 {
00051 // make sure the RTP version is correct
00052 if (this->chd_.ver_ != RTP_VERSION)
00053 return 0;
00054
00055 // these checks are only for the first RTCP packet in a compound packet
00056 if (is_first)
00057 {
00058 // the payload type must be RR or SR
00059 if ((this->chd_.pt_ != RTCP_PT_SR) && (this->chd_.pt_ != RTCP_PT_RR))
00060 return 0;
00061
00062 // the padding bit must not be set
00063 if (this->chd_.pad_ != 0)
00064 return 0;
00065 }
00066
00067 return 1;
00068
00069 }
|
|
|
Returns the size of the packet. Defined in child class. Implemented in RTCP_BYE_Packet, RTCP_RR_Packet, RTCP_SDES_Packet, and RTCP_SR_Packet. Referenced by get_packet_data(). |
|
|
Header data common to all RTCP packets.
Definition at line 70 of file RTCP_Packet.h. Referenced by is_valid(), and RTCP_Packet(). |
|
|
Buffer to hold byte representation of the RTCP packet.
Definition at line 73 of file RTCP_Packet.h. Referenced by get_packet_data(), and RTCP_Packet(). |
1.3.6