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

IncomingRTPPkt Class Reference

A representation for RTP packets received from other participants. More...

#include <cc++/rtpext.h>

Inheritance diagram for IncomingRTPPkt::

RTPPacket List of all members.

Public Methods

 IncomingRTPPkt (RTPQueue &queue, const unsigned char *block, size_t len, struct timeval recvtime)
 Build an RTP packet, given the queue it is going to be inserted, its content, length and reception time. More...

 ~IncomingRTPPkt ()
 Destructor. More...

bool isHeaderValid ()
 Get validity of this packet. More...

bool operator== (const IncomingRTPPkt &p) const
bool operator!= (const IncomingRTPPkt &p) const
uint32 getSSRC () const
 Get synchronization source numeric identifier. More...

RTPSourcegetSource () const
 Get an object that provides information about the source of this packet. More...

uint32 getTimestamp () const
 Get timestamp of this packet. More...

void setRecvTimestamp (const timeval &t)
 Set the time this packet was received at. More...

timeval getRecvTimestamp () const
 Get the time this packet was received at. More...

uint16 getExtUndefined () const
 Get the first 16 bits (in network order) of the header of the RTP header extension. More...

uint32 getExtSize () const
 Get the length (in octets) of the data contained in the header extension. More...


Friends

class RTPQueue
class RTPSource

Detailed Description

A representation for RTP packets received from other participants.

This class is intented to construct packet objects just after every packet is received by the scheduled queue, so that they will be processed in an understandable and format independent manner inside the stack.

Author:
Federico Montesino Pouzols <p5087@quintero.fie.us.es>


Constructor & Destructor Documentation

IncomingRTPPkt::IncomingRTPPkt RTPQueue &   queue,
const unsigned char *   block,
size_t   len,
struct timeval   recvtime
 

Build an RTP packet, given the queue it is going to be inserted, its content, length and reception time.

This constructor links the packet to its source and records the reception of the packet in the correponding source object. However, this constructor does not assume that the packet will be inserted in the queue. Header check, whose result can be consulted via isHeaderValid(), is also performed.

Parameters:
queue   queue the packet would be inserted
block   pointer to the buffer the whole packet is stored in
len   length of the whole packet, expressed in octets
recvtime   time the packet has been received at
Note:
If check fails, the packet is not properly constructed. checking isHeaderValid() is recommended before using a new RTPPacket object.

IncomingRTPPkt::~IncomingRTPPkt  
 

Destructor.


Member Function Documentation

uint32 IncomingRTPPkt::getExtSize   const [inline]
 

Get the length (in octets) of the data contained in the header extension.

Note that this length does not include the four octets at the beginning of the header extension.

Returns:
0 if the packet has no header extension, otherwise the length.
Note:
0 is a valid value for this field, so RTPPacket::isExtended() should be use.

uint16 IncomingRTPPkt::getExtUndefined   const [inline]
 

Get the first 16 bits (in network order) of the header of the RTP header extension.

Its meaning is undefined at this level.

Returns:
0 if the packet has no header extension, otherwise the first 16 bits of the header extension, in network order.
Note:
0 could be a valid value for the first 16 bits, in that case RTPPacket::isExtended() should be use.

timeval IncomingRTPPkt::getRecvTimestamp   const [inline]
 

Get the time this packet was received at.

Parameters:
t   structure where to get the time of reception.
Note:
this has almost nothing to do with the 32-bit timestamp contained in the packet header.

uint32 IncomingRTPPkt::getSSRC   const [inline]
 

Get synchronization source numeric identifier.

Returns:
32-bits Synchronization SouRCe numeric identifier in network order

RTPSource& IncomingRTPPkt::getSource   const [inline]
 

Get an object that provides information about the source of this packet.

Returns:
object representing the source of the packet

uint32 IncomingRTPPkt::getTimestamp   const [inline]
 

Get timestamp of this packet.

The timestamp of incoming packets is filtered so that the timestamp this method provides for the first packet received from every source starts from 0.

Returns:
32 bit timestamp starting from 0 for each source.

bool IncomingRTPPkt::isHeaderValid   [inline]
 

Get validity of this packet.

Returns:
whether the header check performed at construction time ended successfully.

bool IncomingRTPPkt::operator!= const IncomingRTPPkt &   p const [inline]
 

bool IncomingRTPPkt::operator== const IncomingRTPPkt &   p const [inline]
 

void IncomingRTPPkt::setRecvTimestamp const timeval &   t [inline]
 

Set the time this packet was received at.

Parameters:
t   time of reception.
Note:
this has almost nothing to do with the 32-bit timestamp contained in the packet header.


Friends And Related Function Documentation

friend class RTPQueue [friend]
 

friend class RTPSource [friend]
 


The documentation for this class was generated from the following file:
Generated at Sat Jan 5 09:08:54 2002 for ccRTP by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001