sipxmedialib  Version 3.3
Public Types | Private Attributes | List of all members
MpBufferMsg Class Reference

Message object used to communicate with the media processing task. More...

#include <MpBufferMsg.h>

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

Public Types

enum  MpBufferMsgType {
  AUD_RECORDED, AUD_RTP_RECV, AUD_RTCP_RECV, AUD_PLAY,
  ACK_EOSTREAM, VIDEO_FRAME
}
 Phone set message types. More...
 

Public Member Functions

Creators
 MpBufferMsg (int msg, const MpBufPtr &pBuffer=MpBufPtr())
 Constructor. More...
 
 MpBufferMsg (const MpBufferMsg &rMpBufferMsg)
 Copy constructor. More...
 
virtual OsMsg * createCopy () const
 Create a copy of this msg object (which may be of a derived type) More...
 
virtual void releaseMsg ()
 Done with message, delete it or mark it unused. More...
 
virtual ~MpBufferMsg ()
 Destructor. More...
 
Manipulators
MpBufferMsgoperator= (const MpBufferMsg &rhs)
 Assignment operator. More...
 
void setBuffer (const MpBufPtr &p)
 Copy buffer to this message. More...
 
void ownBuffer (MpBufPtr &p)
 Own provided buffer. More...
 
Accessors
int getMsg () const
 Return the type of the buffer message. More...
 
MpBufPtrgetBuffer ()
 Return buffer object pointer from the buffer message. More...
 

Private Attributes

MpBufPtr mpBuffer
 Carried buffer. More...
 

Detailed Description

Message object used to communicate with the media processing task.

Member Enumeration Documentation

Phone set message types.

Enumerator
AUD_RECORDED 

Captured audio frame.

AUD_RTP_RECV 
AUD_RTCP_RECV 
AUD_PLAY 
ACK_EOSTREAM 
VIDEO_FRAME 

Captured video frame.

Constructor & Destructor Documentation

MpBufferMsg ( int  msg,
const MpBufPtr pBuffer = MpBufPtr() 
)

Constructor.

MpBufferMsg ( const MpBufferMsg rMpBufferMsg)

Copy constructor.

~MpBufferMsg ( )
virtual

Destructor.

Member Function Documentation

OsMsg * createCopy ( void  ) const
virtual

Create a copy of this msg object (which may be of a derived type)

void releaseMsg ( )
virtual

Done with message, delete it or mark it unused.

MpBufferMsg & operator= ( const MpBufferMsg rhs)

Assignment operator.

void setBuffer ( const MpBufPtr p)

Copy buffer to this message.

Note, that this function create copy of the buffer! To avoid copying use ownBuffer() function. Copying is needed to avoid racing conditions in MpBuf::detach() code.

void ownBuffer ( MpBufPtr p)

Own provided buffer.

This function may be used to avoid buffer copying when passing buffer to message object. It owns provided buffer and invalidates it, i.e. after execution of this function MpBufPtr::isValid() will return false for passed buffer pointer.

Note, that buffer will not be copied only if MpBufPtr::isWritable() returns true for passed pointer. Copying is needed to avoid racing conditions in MpBuf::detach() code.

int getMsg ( ) const

Return the type of the buffer message.

MpBufPtr & getBuffer ( )

Return buffer object pointer from the buffer message.

Member Data Documentation

MpBufPtr mpBuffer
private

Carried buffer.