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)
 ~IncomingRTPPkt ()
bool isHeaderValid ()
bool operator== (const IncomingRTPPkt &p) const
bool operator!= (const IncomingRTPPkt &p) const
uint32 getSSRC () const
RTPSourcegetSource () const
uint32 getTimestamp () const
void setRecvTimestamp (const timeval &t)
timeval getRecvTimestamp () const
uint16 getExtUndefined () const
uint32 getExtSize () const

Private Methods

 IncomingRTPPkt (const IncomingRTPPkt &ip)
IncomingRTPPkt& operator= (const IncomingRTPPkt &ip)

Private Attributes

IncomingRTPPkt* next
IncomingRTPPkt * prev
IncomingRTPPkt* srcnext
IncomingRTPPkt * srcprev
RTPSourcesource
struct timeval reception_timestamp
bool valid
uint32 cached_timestamp
friend RTPQueue
friend RTPSource

Static Private Attributes

const uint16 RTP_INVALID_MASK = (0x7e)
const uint16 RTP_INVALID_VALUE = (0x48)

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(s):
Federico Montesino Pouzols <p5087@quintero.fie.us.es>

Definition at line 474 of file rtpext.h.


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.

IncomingRTPPkt::IncomingRTPPkt ( const IncomingRTPPkt & ip ) [private]
 

Copy constructor from objects of its same kind, declared private to avoid its use.


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.

Definition at line 610 of file rtpext.h.

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.

Definition at line 595 of file rtpext.h.

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.

Definition at line 579 of file rtpext.h.

uint32 IncomingRTPPkt::getSSRC ( ) const [inline]
 

Get synchronization source numeric identifier.

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

Definition at line 535 of file rtpext.h.

Referenced by operator==().

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

Definition at line 545 of file rtpext.h.

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.

Definition at line 557 of file rtpext.h.

bool IncomingRTPPkt::isHeaderValid ( ) [inline]
 

Get validity of this packet

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

Definition at line 510 of file rtpext.h.

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

Definition at line 525 of file rtpext.h.

IncomingRTPPkt & IncomingRTPPkt::operator= ( const IncomingRTPPkt & ip ) [private]
 

Assignment operator from objects of its same kind, declared private to avoid its use.

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

Definition at line 517 of file rtpext.h.

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.

Definition at line 568 of file rtpext.h.


Member Data Documentation

RTPQueue [private]
 

Definition at line 646 of file rtpext.h.

RTPSource [private]
 

Definition at line 647 of file rtpext.h.

const uint16 IncomingRTPPkt::RTP_INVALID_MASK = (0x7e) [static, private]
 

Definition at line 643 of file rtpext.h.

const uint16 IncomingRTPPkt::RTP_INVALID_VALUE = (0x48) [static, private]
 

Definition at line 644 of file rtpext.h.

uint32 IncomingRTPPkt::cached_timestamp [private]
 

Definition at line 640 of file rtpext.h.

IncomingRTPPkt * IncomingRTPPkt::next [private]
 

Definition at line 628 of file rtpext.h.

IncomingRTPPkt * IncomingRTPPkt::prev [private]
 

Definition at line 628 of file rtpext.h.

struct timeval IncomingRTPPkt::reception_timestamp [private]
 

Definition at line 634 of file rtpext.h.

RTPSource & IncomingRTPPkt::source [private]
 

Definition at line 632 of file rtpext.h.

IncomingRTPPkt * IncomingRTPPkt::srcnext [private]
 

Definition at line 630 of file rtpext.h.

IncomingRTPPkt * IncomingRTPPkt::srcprev [private]
 

Definition at line 630 of file rtpext.h.

bool IncomingRTPPkt::valid [private]
 

Definition at line 636 of file rtpext.h.


The documentation for this class was generated from the following file:
Generated at Fri Oct 5 10:28:26 2001 for ccRTP by doxygen1.2.5 written by Dimitri van Heesch, © 1997-2001