RTPPacket Class Reference

#include <RTPPacket.h>

List of all members.


Detailed Description

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.

Public Member Functions

 RTPPacket (const char *name=NULL)
 RTPPacket (const RTPPacket &packet)
virtual ~RTPPacket ()
RTPPacketoperator= (const RTPPacket &packet)
virtual RTPPacketdup () 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

Constructor & Destructor Documentation

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]

Destructor.

00049                       {
00050     // when csrcList is implemented this
00051     // should free the memory used for it
00052 };


Member Function Documentation

RTPPacket & RTPPacket::operator= ( const RTPPacket packet  ) 

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]

Duplicates the RTPPacket by calling the copy constructor.

00055                                 {
00056     return new RTPPacket(*this);
00057 };

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().

00140                                     {
00141     return 12;
00142 };

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 };


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Fri Mar 20 18:51:21 2009 for INET Framework for OMNeT++/OMNEST by  doxygen 1.5.5