Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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 cObject * dup () const
virtual const char * className () const
virtual std::string info ()
virtual void writeContents (std::ostream &os)
virtual int marker ()
virtual void setMarker (int marker)
virtual int payloadType ()
virtual void setPayloadType (int payloadType)
virtual u_int16 sequenceNumber ()
virtual void setSequenceNumber (u_int16 sequenceNumber)
virtual u_int32 timeStamp ()
virtual void setTimeStamp (u_int32 timeStamp)
virtual u_int32 ssrc ()
virtual void setSSRC (u_int32 ssrc)
virtual int headerLength ()
virtual int payloadLength ()

Static Public Member Functions

static int fixedHeaderLength ()
static int compareFunction (cObject *packet1, cObject *packet2)

Protected Attributes

int _version
int _padding
int _extension
int _csrcCount
int _marker
int _payloadType
u_int16 _sequenceNumber
u_int32 _timeStamp
u_int32 _ssrc


Constructor & Destructor Documentation

RTPPacket::RTPPacket const char *  name = NULL  ) 
 

Default constructor.

00030                                      : cPacket(name) {
00031     _version = 2;
00032     _padding = 0;
00033     _extension = 0;
00034     _csrcCount = 0;
00035     _marker = 0;
00036     _payloadType = 0;
00037     _sequenceNumber = 0;
00038     _timeStamp = 0;
00039     _ssrc = 0;
00040 
00041     // a standard rtp packet without csrcs and data has a length of 12 bytes
00042     setLength(fixedHeaderLength());
00043 };

RTPPacket::RTPPacket const RTPPacket packet  ) 
 

Copy constructor.

00046                                             : cPacket() {
00047     setName(packet.name());
00048     operator=(packet);
00049 };

RTPPacket::~RTPPacket  )  [virtual]
 

Destructor.

00052                       {
00053     // when csrcList is implemented this
00054     // should free the memory used for it
00055 };


Member Function Documentation

const char * RTPPacket::className  )  const [virtual]
 

Returns the class name "RTPPacket".

00078                                        {
00079     return "RTPPacket";
00080 };

int RTPPacket::compareFunction cObject *  packet1,
cObject *  packet2
[static]
 

Compares two RTPPacket objects by comparing their sequence numbers.

00164                                                                  {
00165     return ((RTPPacket *)packet1)->sequenceNumber() - ((RTPPacket *)packet2)->sequenceNumber();
00166 };

cObject * RTPPacket::dup  )  const [virtual]
 

Duplicates the RTPPacket by calling the copy constructor.

00058                               {
00059     return new RTPPacket(*this);
00060 };

int RTPPacket::fixedHeaderLength  )  [static]
 

Returns the length of the fixed header of an RTPPacket.

00148                                  {
00149     return 12;
00150 };

int RTPPacket::headerLength  )  [virtual]
 

Returns the length of the header (fixed plus variable part) of this RTPPacket.

00152                             {
00153     // fixed header is 12 bytes long,
00154     // add 4 bytes for every csrc identifier
00155     return(fixedHeaderLength() + 4 * _csrcCount);
00156 };

std::string RTPPacket::info  )  [virtual]
 

Writes a one line info about this RTPPacket into the given string.

00083                           {
00084     std::stringstream out;
00085     out << "RTPPacket: payloadType=" << _payloadType << " payloadLength=" << payloadLength();
00086     return out.str();
00087 };

int RTPPacket::marker  )  [virtual]
 

Returns the value of the marker bit in this RTPPacket.

00099                       {
00100     return _marker;
00101 };

RTPPacket & RTPPacket::operator= const RTPPacket packet  ) 
 

Assignment operator.

00063                                                        {
00064     cPacket::operator=(packet);
00065     _version = packet._version;
00066     _padding = packet._padding;
00067     _extension = packet._extension;
00068     _csrcCount = packet._csrcCount;
00069     _marker = packet._marker;
00070     _payloadType = packet._payloadType;
00071     _sequenceNumber = packet._sequenceNumber;
00072     _timeStamp = packet._timeStamp;
00073     _ssrc = packet._ssrc;
00074     return *this;
00075 };

int RTPPacket::payloadLength  )  [virtual]
 

Returns the size of the payload stored in this RTPPacket.

00159                              {
00160     return(length() - headerLength());
00161 };

int RTPPacket::payloadType  )  [virtual]
 

Returns the payload type of this RTPPacket.

00109                            {
00110     return _payloadType;
00111 };

u_int16 RTPPacket::sequenceNumber  )  [virtual]
 

Returns the sequence number of this RTPPacket.

00119                                   {
00120     return _sequenceNumber;
00121 };

void RTPPacket::setMarker int  marker  )  [virtual]
 

Sets the value of the marker bit in this RTPPacket.

00104                                     {
00105     _marker = marker;
00106 };

void RTPPacket::setPayloadType int  payloadType  )  [virtual]
 

Sets the payload type of this RTPPacket.

00114                                               {
00115     _payloadType = payloadType;
00116 };

void RTPPacket::setSequenceNumber u_int16  sequenceNumber  )  [virtual]
 

Sets the sequence number of this RTPPacket.

00124                                                         {
00125     _sequenceNumber = sequenceNumber;
00126 };

void RTPPacket::setSSRC u_int32  ssrc  )  [virtual]
 

Sets the ssrc identifier of this RTPPacket.

00144                                     {
00145     _ssrc = ssrc;
00146 };

void RTPPacket::setTimeStamp u_int32  timeStamp  )  [virtual]
 

Sets the rtp time stamp of this RTPPacket.

00134                                               {
00135     _timeStamp = timeStamp;
00136 };

u_int32 RTPPacket::ssrc  )  [virtual]
 

Returns the ssrc identifier of this RTPPacket.

00139                         {
00140     return _ssrc;
00141 };

u_int32 RTPPacket::timeStamp  )  [virtual]
 

Returns the rtp time stamp of this RTPPacket.

00129                              {
00130     return _timeStamp;
00131 };

void RTPPacket::writeContents std::ostream &  os  )  [virtual]
 

Writes a longer description about this RTPPacket into the given stream.

00090                                             {
00091     os << "RTPPacket:" << endl;
00092     os << "  payloadType = " << _payloadType << endl;
00093     os << "  sequenceNumber = " << _sequenceNumber << endl;
00094     os << "  timeStamp = " << _timeStamp << endl;
00095     os << "  payloadLength = " << payloadLength() << endl;
00096 };


Member Data Documentation

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.

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.

int RTPPacket::_marker [protected]
 

The marker of this 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.

int RTPPacket::_payloadType [protected]
 

The type of payload carried in this RTPPacket.

u_int16 RTPPacket::_sequenceNumber [protected]
 

The sequence number of this RTPPacket.

u_int32 RTPPacket::_ssrc [protected]
 

The ssrc identifier of the creator of this RTPPacket.

u_int32 RTPPacket::_timeStamp [protected]
 

The rtp time stamp of this RTPPacket.

int RTPPacket::_version [protected]
 

The rtp version of this RTPPacket.


The documentation for this class was generated from the following files:
Generated on Sat Apr 1 20:52:24 2006 for INET Framework for OMNeT++/OMNEST by  doxygen 1.4.1