sipxmedialib
Version 3.3
|
Base class for all media processing encoders. More...
#include <MpEncoderBase.h>
Public Member Functions | |
Creators | |
MpEncoderBase (int payloadType, const MpCodecCallInfoV1 &callInfo, const MppCodecInfoV1_1 &codecInfo, const char *defaultFmtp) | |
Constructor. More... | |
~MpEncoderBase () | |
Destructor. More... | |
OsStatus | initEncode (const char *fmt) |
Initializes encoder with given fmtp parameters. More... | |
OsStatus | initEncode () |
Initializes encoder with default fmtp parameters. More... | |
OsStatus | freeEncode () |
Frees all memory allocated to the encoder by initEncode() More... | |
Manipulators | |
OsStatus | encode (const MpAudioSample *pAudioSamples, const int numSamples, int &rSamplesConsumed, unsigned char *pCodeBuf, const int bytesLeft, int &rSizeInBytes, UtlBoolean &isPacketReady, UtlBoolean &isPacketSilent, UtlBoolean &shouldSetMarker) |
Encode audio samples. More... | |
Accessors | |
const MpCodecInfo * | getInfo () const |
Get static information about the encoder. More... | |
int | getPayloadType () |
Returns the RTP payload type associated with this encoder. More... | |
Private Member Functions | |
MpEncoderBase (const MpEncoderBase &rMpEncoderBase) | |
Copy constructor. More... | |
MpEncoderBase & | operator= (const MpEncoderBase &rhs) |
Assignment operator. More... | |
Private Attributes | |
int | mPayloadType |
RTP payload type, associated with this codec. More... | |
MpCodecInfo | mCodecInfo |
Codec info structure. More... | |
void * | plgHandle |
Internal codec handle. More... | |
const MpCodecCallInfoV1 & | mCallInfo |
Actual codec's manipulator functions. More... | |
UtlBoolean | mInitialized |
Is codec initialized? More... | |
const char * | mDefaultFmtp |
Default fmtp string. More... | |
Base class for all media processing encoders.
MpEncoderBase | ( | int | payloadType, |
const MpCodecCallInfoV1 & | callInfo, | ||
const MppCodecInfoV1_1 & | codecInfo, | ||
const char * | defaultFmtp | ||
) |
Constructor.
[in] | payloadType | - RTP payload type associated with this encoder. |
[in] | callInfo | - codec manipulator functions. |
[in] | codecInfo | - codec information struct. |
[in] | defaultFmtp | - default codec fmtp string. |
~MpEncoderBase | ( | ) |
Destructor.
|
private |
Copy constructor.
OsStatus initEncode | ( | const char * | fmt | ) |
Initializes encoder with given fmtp parameters.
OS_SUCCESS | - Success. |
OS_FAILED | - Failure. |
OsStatus initEncode | ( | ) |
Initializes encoder with default fmtp parameters.
OS_SUCCESS | - Success. |
OS_FAILED | - Failure. |
OsStatus freeEncode | ( | ) |
Frees all memory allocated to the encoder by initEncode()
OS_SUCCESS | - Success. |
OS_INVALID_STATE | - Object has already been freed. |
OsStatus encode | ( | const MpAudioSample * | pAudioSamples, |
const int | numSamples, | ||
int & | rSamplesConsumed, | ||
unsigned char * | pCodeBuf, | ||
const int | bytesLeft, | ||
int & | rSizeInBytes, | ||
UtlBoolean & | isPacketReady, | ||
UtlBoolean & | isPacketSilent, | ||
UtlBoolean & | shouldSetMarker | ||
) |
Encode audio samples.
Processes the array of audio samples. If sufficient samples to encode a frame are now available, the encoded data will be written to the pCodeBuf
array. The number of bytes written to the pCodeBuf
array is returned in rSizeInBytes
.
[in] | pAudioSamples | - Pointer to array of PCM samples. |
[in] | numSamples | - Number of samples at pAudioSamples. |
[out] | rSamplesConsumed | - Number of samples encoded. |
[out] | pCodeBuf | - Pointer to array for encoded data. |
[in] | bytesLeft | - Number of bytes available at pCodeBuf. |
[out] | rSizeInBytes | - Number of bytes written to the pCodeBuf array. |
[out] | isPacketReady | - If TRUE, encoder finished encoding, so packet may be sent. If DTX is enabled, sendNow should be set to TRUE for all supressed packets too along with isPacketSilent set to TRUE. |
[out] | isPacketSilent | - If TRUE, packet may be not transmitted if DTX is enabled, if FALSE, packet contain active voice data and should always be transmitted. Value of isPacketSilent is ignored with isPacketReady is set to FALSE. |
OS_SUCCESS | - Success. |
const MpCodecInfo * getInfo | ( | ) | const |
Get static information about the encoder.
int getPayloadType | ( | void | ) |
Returns the RTP payload type associated with this encoder.
|
private |
Assignment operator.
|
private |
RTP payload type, associated with this codec.
|
private |
Codec info structure.
|
private |
Internal codec handle.
|
private |
Actual codec's manipulator functions.
|
private |
Is codec initialized?
|
private |
Default fmtp string.