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)
 RTPPacket (size_t hdrlen, size_t plen)
 ~RTPPacket ()
const RTPFixedHeadergetHeader (void) const
uint32 getHeaderSize (void) const
const RTPHeaderExtgetHeaderExt () const
const unsigned char *const getPayload (void) const
uint32 getPayloadSize () const
rtp_payload_t getPayloadType () const
uint16 getSeqNum () const
uint32 getRawTimestamp (void) const
bool isPadded () const
uint8 getPaddingSize () const
bool isMarked () const
bool isExtended () const
uint16 getCSRCsCount () const
const uint32 * getCSRCs () const
const unsigned char *const getRawPacket () const
uint32 getRawPacketSize () const

Protected Methods

void setbuffer (const void *src, size_t len, size_t pos)
void endPacket ()

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>

Definition at line 61 of file rtpext.h.


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.

Definition at line 155 of file rtpext.h.


Member Function Documentation

void RTPPacket::endPacket   [protected]
 

Free memory allocated for the packet

Referenced by ~RTPPacket().

const uint32* RTPPacket::getCSRCs   const [inline]
 

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

Definition at line 276 of file rtpext.h.

uint16 RTPPacket::getCSRCsCount   const [inline]
 

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

Definition at line 268 of file rtpext.h.

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

Definition at line 164 of file rtpext.h.

Referenced by getCSRCs(), getCSRCsCount(), getHeaderExt(), getPayloadType(), getRawTimestamp(), IncomingRTPPkt::getSSRC(), getSeqNum(), isExtended(), isMarked(), isPadded(), OutgoingRTPPkt::setMarker(), OutgoingRTPPkt::setPayloadType(), OutgoingRTPPkt::setSSRC(), OutgoingRTPPkt::setSeqNum(), and OutgoingRTPPkt::setTimestamp().

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.

Definition at line 185 of file rtpext.h.

Referenced by IncomingRTPPkt::getExtSize(), and IncomingRTPPkt::getExtUndefined().

uint32 RTPPacket::getHeaderSize void   const [inline]
 

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

Returns:
number of octets

Definition at line 174 of file rtpext.h.

Referenced by getPayload().

uint8 RTPPacket::getPaddingSize   const [inline]
 

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

Parameters:
padding   length in octets

Definition at line 243 of file rtpext.h.

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

Returns:
pointer to the payload section of the packet

Definition at line 196 of file rtpext.h.

uint32 RTPPacket::getPayloadSize   const [inline]
 

Returns:
lenght of the payload section, in octets

Definition at line 203 of file rtpext.h.

rtp_payload_t RTPPacket::getPayloadType   const [inline]
 

Returns:
value of the PT header field

Definition at line 210 of file rtpext.h.

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

Definition at line 286 of file rtpext.h.

uint32 RTPPacket::getRawPacketSize   const [inline]
 

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

Returns:
size of the raw packet structure

Definition at line 296 of file rtpext.h.

uint32 RTPPacket::getRawTimestamp void   const [inline]
 

Obtain the absolute timestamp carried in the packet header.

Returns:
32-bit timestamp in host order

Definition at line 226 of file rtpext.h.

Referenced by OutgoingRTPPkt::getTimestamp().

uint16 RTPPacket::getSeqNum   const [inline]
 

Returns:
value of the sequence number header field

Definition at line 217 of file rtpext.h.

Referenced by IncomingRTPPkt::operator==(), and OutgoingRTPPkt::operator==().

bool RTPPacket::isExtended   const [inline]
 

Ask whether the packet contains header extensions

Returns:
true if the header extension bit is 1

Definition at line 260 of file rtpext.h.

Referenced by IncomingRTPPkt::getExtSize(), and IncomingRTPPkt::getExtUndefined().

bool RTPPacket::isMarked void   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

Definition at line 252 of file rtpext.h.

bool RTPPacket::isPadded   const [inline]
 

Ask whether the packet contains padding bytes at the end

Returns:
true if the header padding bit is 1

Definition at line 234 of file rtpext.h.

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

Definition at line 301 of file rtpext.h.


Member Data Documentation

unsigned char* RTPPacket::buffer [protected]
 

Definition at line 122 of file rtpext.h.

bool RTPPacket::duplicated [protected]
 

Definition at line 124 of file rtpext.h.

uint32 RTPPacket::hdrsize [protected]
 

Definition at line 116 of file rtpext.h.

uint32 RTPPacket::payload_size [protected]
 

Definition at line 118 of file rtpext.h.

uint32 RTPPacket::total [protected]
 

Definition at line 120 of file rtpext.h.


The documentation for this class was generated from the following file:
Generated at Tue Oct 16 11:17:52 2001 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001