sipxmedialib
Version 3.3
|
Message object used to communicate with the media processing task. More...
#include <MpBufferMsg.h>
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 | |
MpBufferMsg & | operator= (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... | |
MpBufPtr & | getBuffer () |
Return buffer object pointer from the buffer message. More... | |
Private Attributes | |
MpBufPtr | mpBuffer |
Carried buffer. More... | |
Message object used to communicate with the media processing task.
enum MpBufferMsgType |
MpBufferMsg | ( | int | msg, |
const MpBufPtr & | pBuffer = MpBufPtr() |
||
) |
Constructor.
MpBufferMsg | ( | const MpBufferMsg & | rMpBufferMsg | ) |
Copy constructor.
|
virtual |
Destructor.
|
virtual |
Create a copy of this msg object (which may be of a derived type)
|
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.
|
private |
Carried buffer.