#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 |
This class represents an rtp data packet. Real data can either be encapsulated or simulated by adding length. Following rtp header fields exist but aren't used: padding, extension, csrcCount. The csrcList can't be used because csrcCount is always 0.
Definition at line 34 of file RTPPacket.h.
RTPPacket::RTPPacket | ( | const char * | name = NULL |
) |
Default constructor.
Definition at line 27 of file RTPPacket.cc.
Referenced by dup().
: cPacket(name) { _version = 2; _padding = 0; _extension = 0; _csrcCount = 0; _marker = 0; _payloadType = 0; _sequenceNumber = 0; _timeStamp = 0; _ssrc = 0; // a standard rtp packet without csrcs and data has a length of 12 bytes setByteLength(getFixedHeaderLength()); }
RTPPacket::RTPPacket | ( | const RTPPacket & | packet | ) |
Copy constructor.
Definition at line 44 of file RTPPacket.cc.
: cPacket() { setName(packet.getName()); operator=(packet); }
RTPPacket::~RTPPacket | ( | ) | [virtual] |
Destructor.
Definition at line 51 of file RTPPacket.cc.
{ // when csrcList is implemented this // should free the memory used for it }
void RTPPacket::dump | ( | ) | [virtual] |
Writes a longer description about this RTPPacket into the given stream.
Definition at line 88 of file RTPPacket.cc.
Referenced by RTP::readRet().
{ ev << "RTPPacket:" << endl; ev << " payloadType = " << _payloadType << endl; ev << " sequenceNumber = " << _sequenceNumber << endl; ev << " timeStamp = " << _timeStamp << endl; ev << " payloadLength = " << getPayloadLength() << endl; }
RTPPacket * RTPPacket::dup | ( | ) | const [virtual] |
Duplicates the RTPPacket by calling the copy constructor.
Definition at line 58 of file RTPPacket.cc.
{ return new RTPPacket(*this); }
int RTPPacket::getFixedHeaderLength | ( | ) | [static] |
Returns the length of the fixed header of an RTPPacket.
Definition at line 157 of file RTPPacket.cc.
Referenced by getHeaderLength(), and RTPPacket().
{
return 12;
}
int RTPPacket::getHeaderLength | ( | ) | [virtual] |
Returns the length of the header (fixed plus variable part) of this RTPPacket.
Definition at line 162 of file RTPPacket.cc.
Referenced by getPayloadLength().
{ // fixed header is 12 bytes long, // add 4 bytes for every csrc identifier return(getFixedHeaderLength() + 4 * _csrcCount); }
int RTPPacket::getMarker | ( | ) | [virtual] |
Returns the value of the marker bit in this RTPPacket.
Definition at line 98 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Receiver::processPacket().
{ return _marker; }
int RTPPacket::getPayloadLength | ( | ) | [virtual] |
Returns the size of the payload stored in this RTPPacket.
Definition at line 170 of file RTPPacket.cc.
Referenced by dump(), info(), and RTPSenderInfo::processRTPPacket().
{ return(getByteLength() - getHeaderLength()); }
int RTPPacket::getPayloadType | ( | ) | [virtual] |
Returns the payload type of this RTPPacket.
Definition at line 110 of file RTPPacket.cc.
Referenced by RTPProfile::dataIn().
{ return _payloadType; }
uint16 RTPPacket::getSequenceNumber | ( | ) | [virtual] |
Returns the sequence number of this RTPPacket.
Definition at line 122 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Receiver::processPacket(), and RTPReceiverInfo::processRTPPacket().
{ return _sequenceNumber; }
uint32 RTPPacket::getSSRC | ( | ) | [virtual] |
Returns the ssrc identifier of this RTPPacket.
Definition at line 146 of file RTPPacket.cc.
Referenced by RTPProfile::dataIn(), and RTCP::processIncomingRTPPacket().
{ return _ssrc; }
uint32 RTPPacket::getTimeStamp | ( | ) | [virtual] |
Returns the rtp time stamp of this RTPPacket.
Definition at line 134 of file RTPPacket.cc.
Referenced by RTPPayloadReceiver::processPacket(), RTPAVProfilePayload32Receiver::processPacket(), and RTPReceiverInfo::processRTPPacket().
{ return _timeStamp; }
std::string RTPPacket::info | ( | ) | [virtual] |
Writes a one line info about this RTPPacket into the given string.
Definition at line 80 of file RTPPacket.cc.
{ std::stringstream out; out << "RTPPacket: payloadType=" << _payloadType << " payloadLength=" << getPayloadLength(); return out.str(); }
Assignment operator.
Definition at line 64 of file RTPPacket.cc.
Referenced by RTPPacket().
{ cPacket::operator=(packet); _version = packet._version; _padding = packet._padding; _extension = packet._extension; _csrcCount = packet._csrcCount; _marker = packet._marker; _payloadType = packet._payloadType; _sequenceNumber = packet._sequenceNumber; _timeStamp = packet._timeStamp; _ssrc = packet._ssrc; return *this; }
void RTPPacket::setMarker | ( | int | marker | ) | [virtual] |
Sets the value of the marker bit in this RTPPacket.
Definition at line 104 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _marker = marker; }
void RTPPacket::setPayloadType | ( | int | payloadType | ) | [virtual] |
Sets the payload type of this RTPPacket.
Definition at line 116 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _payloadType = payloadType; }
void RTPPacket::setSequenceNumber | ( | uint16 | sequenceNumber | ) | [virtual] |
Sets the sequence number of this RTPPacket.
Definition at line 128 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _sequenceNumber = sequenceNumber; }
void RTPPacket::setSSRC | ( | uint32 | ssrc | ) | [virtual] |
Sets the ssrc identifier of this RTPPacket.
Definition at line 152 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _ssrc = ssrc; }
void RTPPacket::setTimeStamp | ( | uint32 | timeStamp | ) | [virtual] |
Sets the rtp time stamp of this RTPPacket.
Definition at line 140 of file RTPPacket.cc.
Referenced by RTPAVProfilePayload32Sender::sendPacket().
{ _timeStamp = timeStamp; }
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.
Definition at line 163 of file RTPPacket.h.
Referenced by getHeaderLength(), 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.
Definition at line 156 of file RTPPacket.h.
Referenced by operator=(), and RTPPacket().
int RTPPacket::_marker [protected] |
The marker of this RTPPacket.
Definition at line 168 of file RTPPacket.h.
Referenced by getMarker(), operator=(), RTPPacket(), and setMarker().
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.
Definition at line 150 of file RTPPacket.h.
Referenced by operator=(), and RTPPacket().
int RTPPacket::_payloadType [protected] |
The type of payload carried in this RTPPacket.
Definition at line 173 of file RTPPacket.h.
Referenced by dump(), getPayloadType(), info(), operator=(), RTPPacket(), and setPayloadType().
uint16 RTPPacket::_sequenceNumber [protected] |
The sequence number of this RTPPacket.
Definition at line 178 of file RTPPacket.h.
Referenced by dump(), getSequenceNumber(), operator=(), RTPPacket(), and setSequenceNumber().
uint32 RTPPacket::_ssrc [protected] |
The ssrc identifier of the creator of this RTPPacket.
Definition at line 188 of file RTPPacket.h.
Referenced by getSSRC(), operator=(), RTPPacket(), and setSSRC().
uint32 RTPPacket::_timeStamp [protected] |
The rtp time stamp of this RTPPacket.
Definition at line 183 of file RTPPacket.h.
Referenced by dump(), getTimeStamp(), operator=(), RTPPacket(), and setTimeStamp().
int RTPPacket::_version [protected] |
The rtp version of this RTPPacket.
Definition at line 144 of file RTPPacket.h.
Referenced by operator=(), and RTPPacket().