sipxmedialib
Version 3.3
|
Base class for all media processing decoders. More...
#include <MpDecoderBase.h>
Public Member Functions | |
Creators | |
MpDecoderBase (int payloadType, const MpCodecCallInfoV1 &callInfo, const MppCodecInfoV1_1 &codecInfo, const char *defaultFmtp) | |
Constructor. More... | |
~MpDecoderBase () | |
Destructor. More... | |
OsStatus | initDecode (const char *codecFmtString) |
Initializes a codec data structure for use as a decoder. More... | |
OsStatus | initDecode () |
Initializes a codec data structure for use as a decoder using default fmtp. More... | |
OsStatus | freeDecode () |
Frees all memory allocated to the decoder by initDecode() More... | |
Manipulators | |
int | decode (const MpRtpBufPtr &pPacket, unsigned decodedBufferLength, MpAudioSample *samplesBuffer) |
Decode incoming RTP packet. More... | |
Accessors | |
const MpCodecInfo * | getInfo () const |
Get information about the decoder. More... | |
int | getPayloadType () |
Returns the RTP payload type associated with this decoder. More... | |
OsStatus | getSignalingData (uint8_t &event, UtlBoolean &isStarted, UtlBoolean &isStopped, uint16_t &duration) |
Get signaling data from last decoded packet. More... | |
Private Member Functions | |
bool | isInitialized () const |
Is codec initialized? More... | |
MpDecoderBase (const MpDecoderBase &rMpDecoderBase) | |
Copy constructor. More... | |
MpDecoderBase & | operator= (const MpDecoderBase &rhs) |
Assignment operator. More... | |
Private Attributes | |
int | mPayloadType |
RTP payload type associated with this decoder. More... | |
MpCodecInfo | mCodecInfo |
Info structure for this codec. More... | |
const MpCodecCallInfoV1 & | mCallInfo |
this codec. More... | |
void * | plgHandle |
Codec internal handle. More... | |
const char * | mDefaultFmtp |
Fmtp to use if not passed to initDecode(). More... | |
Base class for all media processing decoders.
MpDecoderBase | ( | int | payloadType, |
const MpCodecCallInfoV1 & | callInfo, | ||
const MppCodecInfoV1_1 & | codecInfo, | ||
const char * | defaultFmtp | ||
) |
Constructor.
[in] | payloadType | - RTP payload type associated with this decoder |
~MpDecoderBase | ( | ) |
Destructor.
|
private |
Copy constructor.
OsStatus initDecode | ( | const char * | codecFmtString | ) |
Initializes a codec data structure for use as a decoder.
OS_SUCCESS | - Success |
OS_NO_MEMORY | - Memory allocation failure |
OsStatus initDecode | ( | ) |
Initializes a codec data structure for use as a decoder using default fmtp.
OS_SUCCESS | - Success |
OS_NO_MEMORY | - Memory allocation failure |
OsStatus freeDecode | ( | ) |
Frees all memory allocated to the decoder by initDecode()
OS_SUCCESS | - Success. |
OS_INVALID_STATE | - Object has already been freed. |
int decode | ( | const MpRtpBufPtr & | pPacket, |
unsigned | decodedBufferLength, | ||
MpAudioSample * | samplesBuffer | ||
) |
Decode incoming RTP packet.
This method is called by MprDecode for every incoming RTP packet. If codec have internal PLC, then this method is also called for every lost packet with pPacket=NULL
to leverage codec's internal PLC. For signaling codecs (namely RFC2833/4733) right after decode() MprDecode calls getSignalingData() to retrieve decoded signaling data. That is decoder should cache this data internally between decode() and getSignalingData() calls.
[in] | pPacket | - Pointer to a RTP packet. May be NULL if packet was lost. |
[in] | decodedBufferLength | - Length of the samplesBuffer (in samples). |
[out] | samplesBuffer | - Buffer for decoded samples. |
const MpCodecInfo * getInfo | ( | ) | const |
Get information about the decoder.
int getPayloadType | ( | void | ) |
Returns the RTP payload type associated with this decoder.
OsStatus getSignalingData | ( | uint8_t & | event, |
UtlBoolean & | isStarted, | ||
UtlBoolean & | isStopped, | ||
uint16_t & | duration | ||
) |
Get signaling data from last decoded packet.
If codec is signaling, that is it is able to carry signaling data, this function is called right after decode() to get signaling data from last decoded RTP packet.
OS_SUCCESS | - Last decoded packet had signaling data, key , pressState and duration were filled with decoded values. |
OS_NO_MORE_DATA | - Last packet had no meaningful signaling data. |
OS_NOT_SUPPORTED | - This codec is pure audio codec and could not carry any signaling data. |
|
inlineprivate |
Is codec initialized?
|
private |
Assignment operator.
|
private |
RTP payload type associated with this decoder.
|
private |
Info structure for this codec.
|
private |
this codec.
Pointers to actual methods of
|
private |
Codec internal handle.
|
private |
Fmtp to use if not passed to initDecode().