#include <RTPPacket.h>
Public Member Functions | |
RTPPacket (const char *name=NULL) | |
RTPPacket (const RTPPacket &packet) | |
virtual | ~RTPPacket () |
RTPPacket & | operator= (const RTPPacket &packet) |
virtual RTPPacket * | dup () const |
virtual std::string | info () |
virtual void | dump () |
virtual int | getMarker () |
virtual void | setMarker (int marker) |
virtual int | getPayloadType () |
virtual void | setPayloadType (int payloadType) |
virtual uint16 | getSequenceNumber () |
virtual void | setSequenceNumber (uint16 sequenceNumber) |
virtual uint32 | getTimeStamp () |
virtual void | setTimeStamp (uint32 timeStamp) |
virtual uint32 | getSSRC () |
virtual void | setSSRC (uint32 ssrc) |
virtual int | getHeaderLength () |
virtual int | getPayloadLength () |
Static Public Member Functions | |
static int | getFixedHeaderLength () |
Protected Attributes | |
int | _version |
int | _padding |
int | _extension |
int | _csrcCount |
int | _marker |
int | _payloadType |
uint16 | _sequenceNumber |
uint32 | _timeStamp |
uint32 | _ssrc |
RTPPacket::RTPPacket | ( | const char * | name = NULL |
) |
Default constructor.
Referenced by dup().
00027 : cPacket(name) { 00028 _version = 2; 00029 _padding = 0; 00030 _extension = 0; 00031 _csrcCount = 0; 00032 _marker = 0; 00033 _payloadType = 0; 00034 _sequenceNumber = 0; 00035 _timeStamp = 0; 00036 _ssrc = 0; 00037 00038 // a standard rtp packet without csrcs and data has a length of 12 bytes 00039 setByteLength(getFixedHeaderLength()); 00040 };
RTPPacket::RTPPacket | ( | const RTPPacket & | packet | ) |
Copy constructor.
00043 : cPacket() { 00044 setName(packet.getName()); 00045 operator=(packet); 00046 };
RTPPacket::~RTPPacket | ( | ) | [virtual] |
Assignment operator.
Referenced by RTPPacket().
00060 { 00061 cPacket::operator=(packet); 00062 _version = packet._version; 00063 _padding = packet._padding; 00064 _extension = packet._extension; 00065 _csrcCount = packet._csrcCount; 00066 _marker = packet._marker; 00067 _payloadType = packet._payloadType; 00068 _sequenceNumber = packet._sequenceNumber; 00069 _timeStamp = packet._timeStamp; 00070 _ssrc = packet._ssrc; 00071 return *this; 00072 };
RTPPacket * RTPPacket::dup | ( | ) | const [virtual] |
std::string RTPPacket::info | ( | ) | [virtual] |
Writes a one line info about this RTPPacket into the given string.
00075 { 00076 std::stringstream out; 00077 out << "RTPPacket: payloadType=" << _payloadType << " payloadLength=" << getPayloadLength(); 00078 return out.str(); 00079 };
void RTPPacket::dump | ( | ) | [virtual] |
Writes a longer description about this RTPPacket into the given stream.
Referenced by RTP::readRet().
00082 { 00083 ev << "RTPPacket:" << endl; 00084 ev << " payloadType = " << _payloadType << endl; 00085 ev << " sequenceNumber = " << _sequenceNumber << endl; 00086 ev << " timeStamp = " << _timeStamp << endl; 00087 ev << " payloadLength = " << getPayloadLength() << endl; 00088 };
int RTPPacket::getMarker | ( | ) | [virtual] |
Returns the value of the marker bit in this RTPPacket.
Referenced by RTPAVProfilePayload32Receiver::processPacket().
00091 { 00092 return _marker; 00093 };
void RTPPacket::setMarker | ( | int | marker | ) | [virtual] |
Sets the value of the marker bit in this RTPPacket.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
00096 { 00097 _marker = marker; 00098 };
int RTPPacket::getPayloadType | ( | ) | [virtual] |
Returns the payload type of this RTPPacket.
Referenced by RTPProfile::dataIn().
00101 { 00102 return _payloadType; 00103 };
void RTPPacket::setPayloadType | ( | int | payloadType | ) | [virtual] |
Sets the payload type of this RTPPacket.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
00106 { 00107 _payloadType = payloadType; 00108 };
uint16 RTPPacket::getSequenceNumber | ( | ) | [virtual] |
Returns the sequence number of this RTPPacket.
Referenced by RTPAVProfilePayload32Receiver::processPacket(), and RTPReceiverInfo::processRTPPacket().
00111 { 00112 return _sequenceNumber; 00113 };
void RTPPacket::setSequenceNumber | ( | uint16 | sequenceNumber | ) | [virtual] |
Sets the sequence number of this RTPPacket.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
00116 { 00117 _sequenceNumber = sequenceNumber; 00118 };
uint32 RTPPacket::getTimeStamp | ( | ) | [virtual] |
Returns the rtp time stamp of this RTPPacket.
Referenced by RTPPayloadReceiver::processPacket(), RTPAVProfilePayload32Receiver::processPacket(), and RTPReceiverInfo::processRTPPacket().
00121 { 00122 return _timeStamp; 00123 };
void RTPPacket::setTimeStamp | ( | uint32 | timeStamp | ) | [virtual] |
Sets the rtp time stamp of this RTPPacket.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
00126 { 00127 _timeStamp = timeStamp; 00128 };
uint32 RTPPacket::getSSRC | ( | ) | [virtual] |
Returns the ssrc identifier of this RTPPacket.
Referenced by RTPProfile::dataIn(), and RTCP::processIncomingRTPPacket().
00131 { 00132 return _ssrc; 00133 };
void RTPPacket::setSSRC | ( | uint32 | ssrc | ) | [virtual] |
Sets the ssrc identifier of this RTPPacket.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
00136 { 00137 _ssrc = ssrc; 00138 };
int RTPPacket::getFixedHeaderLength | ( | ) | [static] |
Returns the length of the fixed header of an RTPPacket.
Referenced by getHeaderLength(), and RTPPacket().
int RTPPacket::getHeaderLength | ( | ) | [virtual] |
Returns the length of the header (fixed plus variable part) of this RTPPacket.
Referenced by getPayloadLength().
00144 { 00145 // fixed header is 12 bytes long, 00146 // add 4 bytes for every csrc identifier 00147 return(getFixedHeaderLength() + 4 * _csrcCount); 00148 };
int RTPPacket::getPayloadLength | ( | ) | [virtual] |
Returns the size of the payload stored in this RTPPacket.
Referenced by dump(), info(), and RTPSenderInfo::processRTPPacket().
00151 { 00152 return(getByteLength() - getHeaderLength()); 00153 };
int RTPPacket::_version [protected] |
The rtp version of this RTPPacket.
Referenced by operator=(), and RTPPacket().
int RTPPacket::_padding [protected] |
Set to 1 if padding is used in this RTPPacket, 0 otherwise. This implementation doesn't use padding bytes, so it is always 0.
Referenced by operator=(), and RTPPacket().
int RTPPacket::_extension [protected] |
Set to 1, if this RTPPacket contains an rtp header extension, 0 otherwise. This implementation doesn't support rtp header extensions, so it is always 0.
Referenced by operator=(), and RTPPacket().
int RTPPacket::_csrcCount [protected] |
Stores the number (0..31) of contributing sources for this RTPPacket. It is always 0 because contributing sources are added by rtp mixers which aren't implemented.
Referenced by getHeaderLength(), operator=(), and RTPPacket().
int RTPPacket::_marker [protected] |
The marker of this RTPPacket.
Referenced by getMarker(), operator=(), RTPPacket(), and setMarker().
int RTPPacket::_payloadType [protected] |
The type of payload carried in this RTPPacket.
Referenced by dump(), getPayloadType(), info(), operator=(), RTPPacket(), and setPayloadType().
uint16 RTPPacket::_sequenceNumber [protected] |
The sequence number of this RTPPacket.
Referenced by dump(), getSequenceNumber(), operator=(), RTPPacket(), and setSequenceNumber().
uint32 RTPPacket::_timeStamp [protected] |
The rtp time stamp of this RTPPacket.
Referenced by dump(), getTimeStamp(), operator=(), RTPPacket(), and setTimeStamp().
uint32 RTPPacket::_ssrc [protected] |
The ssrc identifier of the creator of this RTPPacket.
Referenced by getSSRC(), operator=(), RTPPacket(), and setSSRC().