sipxmedialib  Version 3.3
Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
MpUdpBuf Struct Reference

Buffer for raw UDP packet. More...

#include <MpUdpBuf.h>

Inheritance diagram for MpUdpBuf:
Inheritance graph
[legend]
Collaboration diagram for MpUdpBuf:
Collaboration graph
[legend]

Public Member Functions

Manipulators
bool setPacketSize (int size)
 Set size of packet data in bytes. More...
 
void setTimecode (unsigned timecode)
 Set time code for this packet. More...
 
void setIP (const in_addr &ip)
 Set source/destination address for this packet. More...
 
void setUdpPort (unsigned port)
 Set source/destination UDP port for this packet. More...
 
Accessors
unsigned getPacketSize () const
 Get size of packet data in bytes. More...
 
unsigned getMaximumPacketSize () const
 Get maximum size of data this buffer can bear. More...
 
unsigned getTimecode () const
 Get time code for this packet. More...
 
const in_addr & getIP () const
 Get source/destination address for this packet. More...
 
unsigned getUdpPort () const
 Get source/destination UDP port for this packet. More...
 
- Public Member Functions inherited from MpDataBuf
void setData (const MpArrayBufPtr &pData)
 Set new payload data. More...
 
char * getDataWritePtr ()
 Return pointer to payload data. More...
 
const char * getDataPtr () const
 Return pointer to payload data. More...
 
MpArrayBufPtr getData () const
 Get payload data. More...
 
- Public Member Functions inherited from MpBuf
void attach ()
 Increments reference counter. More...
 
void detach ()
 Decrements reference counter and free buffer if needed. More...
 
void setFlowGraph (MpFlowGraphBase *flowgraph)
 
MP_BUFFERS_TREE getType () const
 Get buffer type. More...
 
MpBufPoolgetBufferPool () const
 Get parent pool of this buffer. More...
 

Static Public Attributes

static MpBufPoolsmpDefaultPool = NULL
 Default pool for this type of buffer. More...
 
- Static Public Attributes inherited from MpDataBuf
static MpBufPoolsmpDefaultPool = NULL
 Default pool for MpDataBuf objects. More...
 

Protected Member Functions

void init ()
 This is called in place of constructor. More...
 
- Protected Member Functions inherited from MpDataBuf
void init ()
 This is called in place of constructor. More...
 

Protected Attributes

unsigned mTimecode
 
in_addr mIP
 Source/destination IP-addres of this packet. More...
 
unsigned mPort
 Source/destination UDP-port of this packet. More...
 
- Protected Attributes inherited from MpDataBuf
MpArrayBufPtr mpData
 Payload data. More...
 
- Protected Attributes inherited from MpBuf
MP_BUFFERS_TREE mType
 Buffer class type. Used for type safety. More...
 
int mRefCounter
 Reference counter for use with MpBufPtr. More...
 
MpBufPoolmpPool
 Parent memory pool. More...
 
MpFlowGraphBasempFlowGraph
 Debug pointer to flowgraph in which this buf is used. More...
 
void(* mpDestroy )(MpBuf *)
 
void(* mpInitClone )(MpBuf *)
 

Private Member Functions

 MpUdpBuf (const MpBuf &)
 Disable copy (and other) constructor. More...
 
MpUdpBufoperator= (const MpBuf &)
 Disable assignment operator. More...
 

Friends

class MpUdpBufPtr
 

Additional Inherited Members

- Static Protected Member Functions inherited from MpDataBuf
static void sDestroy (MpBuf *pBuffer)
 Destructor for MpDataBuf. More...
 
static void sInitClone (MpBuf *pBuffer)
 Function that initialize buffer after cloning. It makes clone of mpData. More...
 
- Static Protected Member Functions inherited from MpBuf
static void sInitClone (MpBuf *pBuffer)
 Function that initialize buffer after cloning. It adjusts reference counters. More...
 

Detailed Description

Buffer for raw UDP packet.

This is only the header for UDP packet. It contain some UDP-specific data and pointer to external data (cause it is based on MpDataBuf).

Constructor & Destructor Documentation

MpUdpBuf ( const MpBuf )
private

Disable copy (and other) constructor.

This struct will be initialized by init() member.

Member Function Documentation

bool setPacketSize ( int  size)
inline

Set size of packet data in bytes.

See also
MpArrayBuf::setDataSize() for more details
void setTimecode ( unsigned  timecode)
inline

Set time code for this packet.

void setIP ( const in_addr &  ip)
inline

Set source/destination address for this packet.

void setUdpPort ( unsigned  port)
inline

Set source/destination UDP port for this packet.

unsigned getPacketSize ( ) const
inline

Get size of packet data in bytes.

unsigned getMaximumPacketSize ( ) const
inline

Get maximum size of data this buffer can bear.

unsigned getTimecode ( ) const
inline

Get time code for this packet.

const in_addr& getIP ( ) const
inline

Get source/destination address for this packet.

unsigned getUdpPort ( ) const
inline

Get source/destination UDP port for this packet.

void init ( )
protected

This is called in place of constructor.

MpUdpBuf& operator= ( const MpBuf )
private

Disable assignment operator.

Buffers may be copied. But do we need this?

Friends And Related Function Documentation

friend class MpUdpBufPtr
friend

Member Data Documentation

MpBufPool * smpDefaultPool = NULL
static

Default pool for this type of buffer.

unsigned mTimecode
protected

Time when this packet is received. It may be used in jitter buffer or somewhere else.

in_addr mIP
protected

Source/destination IP-addres of this packet.

unsigned mPort
protected

Source/destination UDP-port of this packet.