Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

RTPPacket Class Reference

A base class for both IncomingRTPPkt and OutgoingRTPPkt. More...

#include <cc++/rtpext.h>

Inheritance diagram for RTPPacket::

IncomingRTPPkt OutgoingRTPPkt List of all members.

Public Methods

 RTPPacket (const unsigned char *const block, size_t len, bool duplicate=false)
 Constructor, construct a packet object given the memory zone its content is stored. More...

 RTPPacket (size_t hdrlen, size_t plen)
 Constructor, construct a packet object without specifying its real content yet. More...

 ~RTPPacket ()
 Destructor, free the buffer provided in the constructor. More...

const RTPFixedHeadergetHeader (void) const
 Return low level structure for the header of the packet. More...

uint32 getHeaderSize (void) const
 Obtain the length of the header, including contributing sources and header extension, if present. More...

const RTPHeaderExtgetHeaderExt () const
 Get a pointer to RTPHeaderExt pointing after the RTP header (fixed part plus contributing sources). More...

const unsigned char *const getPayload (void) const
uint32 getPayloadSize () const
rtp_payload_t getPayloadType () const
uint16 getSeqNum () const
bool isPadded () const
 Ask whether the packet contains padding bytes at the end. More...

uint8 getPaddingSize () const
 Get the number of octets padding the end of the payload section. More...

bool isMarked () const
 Ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles). More...

bool isExtended () const
 Ask whether the packet contains header extensions. More...

uint16 getCSRCsCount () const
 Get the number of contributing sources specified in the packet header. More...

const uint32 * getCSRCs () const
 Get the 32-bit identifiers of the contributing sources for the packet as an array, of length getCSRCsCount(). More...

const unsigned char *const getRawPacket () const
 Get the raw packet as it will be sent through the network. More...

uint32 getRawPacketSize () const
 Get the raw packet length, including header, extension, payload and padding. More...


Protected Methods

uint32 getRawTimestamp (void) const
 Obtain the absolute timestamp carried in the packet header. More...

void setbuffer (const void *src, size_t len, size_t pos)
void endPacket ()
 Free memory allocated for the packet. More...


Protected Attributes

uint32 hdrsize
uint32 payload_size
uint32 total
unsigned char * buffer
bool duplicated

Detailed Description

A base class for both IncomingRTPPkt and OutgoingRTPPkt.

Provides common low level header structures and related methods.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

RTPPacket::RTPPacket const unsigned char *const   block,
size_t   len,
bool   duplicate = false
 

Constructor, construct a packet object given the memory zone its content is stored.

Parameters:
block   whole packet
len   total length (header + payload + padding) of the packet
duplicate   whether to memcopy the packet. At present, this feature is not used.
Note:
used in IncomingRTPPkt.

RTPPacket::RTPPacket size_t   hdrlen,
size_t   plen
 

Constructor, construct a packet object without specifying its real content yet.

Parameters:
hdrlen   length of the header (including CSRC and extension)
len   payload length.
Note:
used in OutgoingRTPPkt.

RTPPacket::~RTPPacket   [inline]
 

Destructor, free the buffer provided in the constructor.


Member Function Documentation

void RTPPacket::endPacket   [protected]
 

Free memory allocated for the packet.

const uint32* RTPPacket::getCSRCs   const [inline]
 

Get the 32-bit identifiers of the contributing sources for the packet as an array, of length getCSRCsCount().

uint16 RTPPacket::getCSRCsCount   const [inline]
 

Get the number of contributing sources specified in the packet header.

const RTPFixedHeader* RTPPacket::getHeader void   const [inline]
 

Return low level structure for the header of the packet.

Returns:
RTPFixedHeader pointer to the header of the packet

const RTPHeaderExt* RTPPacket::getHeaderExt   const [inline]
 

Get a pointer to RTPHeaderExt pointing after the RTP header (fixed part plus contributing sources).

No check for for the X bit is done.

Returns:
header extension if present, garbage if not.

uint32 RTPPacket::getHeaderSize void   const [inline]
 

Obtain the length of the header, including contributing sources and header extension, if present.

Returns:
number of octets

uint8 RTPPacket::getPaddingSize   const [inline]
 

Get the number of octets padding the end of the payload section.

Parameters:
padding   length in octets

const unsigned char* const RTPPacket::getPayload void   const [inline]
 

Returns:
pointer to the payload section of the packet

uint32 RTPPacket::getPayloadSize   const [inline]
 

Returns:
lenght of the payload section, in octets

rtp_payload_t RTPPacket::getPayloadType   const [inline]
 

Returns:
value of the PT header field

const unsigned char* const RTPPacket::getRawPacket   const [inline]
 

Get the raw packet as it will be sent through the network.

Returns:
memory zone where the raw packet structure is stored in

uint32 RTPPacket::getRawPacketSize   const [inline]
 

Get the raw packet length, including header, extension, payload and padding.

Returns:
size of the raw packet structure

uint32 RTPPacket::getRawTimestamp void   const [inline, protected]
 

Obtain the absolute timestamp carried in the packet header.

Returns:
32-bit timestamp in host order

uint16 RTPPacket::getSeqNum   const [inline]
 

Returns:
value of the sequence number header field

bool RTPPacket::isExtended   const [inline]
 

Ask whether the packet contains header extensions.

Returns:
true if the header extension bit is 1

bool RTPPacket::isMarked   const [inline]
 

Ask whether the packet is marked (for isntance, is a new talk spurt in some audio profiles).

Returns:
true is the header marker bit is 1

bool RTPPacket::isPadded   const [inline]
 

Ask whether the packet contains padding bytes at the end.

Returns:
true if the header padding bit is 1

void RTPPacket::setbuffer const void *   src,
size_t   len,
size_t   pos
[inline, protected]
 


Member Data Documentation

unsigned char* RTPPacket::buffer [protected]
 

bool RTPPacket::duplicated [protected]
 

uint32 RTPPacket::hdrsize [protected]
 

uint32 RTPPacket::payload_size [protected]
 

uint32 RTPPacket::total [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Dec 5 07:18:09 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001