sipxmedialib
Version 3.3
|
#include <MpCodecFactory.h>
Public Member Functions | |
Accessors | |
OsStatus | createDecoder (const UtlString &mime, const UtlString &fmtp, int sampleRate, int numChannels, int payloadType, MpDecoderBase *&rpDecoder) const |
Returns a new instance of a decoder of the indicated type. More... | |
OsStatus | createEncoder (const UtlString &mime, const UtlString &fmtp, int sampleRate, int numChannels, int payloadType, MpEncoderBase *&rpEncoder) const |
Returns a new instance of an encoder of the indicated type. More... | |
void | getCodecInfoArray (unsigned &count, const MppCodecInfoV1_1 **&codecInfoArray) const |
Get list of all codecs' info. More... | |
void | addCodecsToList (SdpCodecList &codecList) const |
Add all supported codecs to SDP descriptions list. More... | |
Static Public Member Functions | |
Creators | |
static MpCodecFactory * | getMpCodecFactory (void) |
Get/create singleton factory. More... | |
static void | freeSingletonHandle () |
Deinitialize all static codecs and freeing handle. Should be called only mpShutdown() More... | |
Protected Member Functions | |
MpCodecFactory () | |
Constructor (called only indirectly via getMpCodecFactory()) More... | |
~MpCodecFactory () | |
Destructor. More... | |
MpCodecSubInfo * | searchByMIME (const UtlString &mime, int sampleRate, int numChannels) const |
Search codec by given MIME-subtype, sample rate and channels number. More... | |
void | freeAllLoadedLibsAndCodec () |
Deinitialize all dynamic codecs. Should be called only from mpShutdown() More... | |
void | initializeStaticCodecs () |
Initialize all static codecs. More... | |
Static Protected Member Functions | |
static void | freeStaticCodecs () |
Freeing internal data of static codecs. Should be called only from global .dtor. More... | |
Private Member Functions | |
OsStatus | addCodecWrapperV1 (MpCodecCallInfoV1 *wrapper) |
Add new codec wrapper to codec list. More... | |
void | updateCodecInfoCache () const |
Update cached array of MIME-types of loaded codecs. More... | |
MpCodecFactory (const MpCodecFactory &rMpCodecFactory) | |
Copy constructor (not supported) More... | |
MpCodecFactory & | operator= (const MpCodecFactory &rhs) |
Assignment operator (not supported) More... | |
Private Attributes | |
UtlHashBag | mCodecsInfo |
List of all known and workable codecs. More... | |
UtlBoolean | mCodecInfoCacheValid |
Should we rebuild MIME-subtypes cache? More... | |
unsigned | mCachedCodecInfoNum |
Number of elements in mpMimeTypesCache. More... | |
const MppCodecInfoV1_1 ** | mpCodecInfoCache |
This is used as return value of getMimeTypes(). More... | |
Static Private Attributes | |
static MpCodecFactory * | spInstance = NULL |
Pointer to the singleton instance. More... | |
static OsBSem | sLock |
static MpCodecCallInfoV1 * | sStaticCodecsV1 = NULL |
Filled by global magic .ctor. More... | |
Manipulators | |
static MpCodecCallInfoV1 * | addStaticCodec (MpCodecCallInfoV1 *sStaticCode) |
Add static codec to factory. More... | |
OsStatus | loadDynCodec (const char *name) |
Load specified codec plugin. More... | |
OsStatus | loadAllDynCodecs (const char *path, const char *regexFilter) |
Load all codec plugins within specified path and filter. More... | |
Singleton class used to generate encoder and decoder objects of an indicated type.
|
protected |
Constructor (called only indirectly via getMpCodecFactory())
We identify this as a protected (rather than a private) method so that gcc doesn't complain that the class only defines a private constructor and has no friends.
|
protected |
Destructor.
|
private |
Copy constructor (not supported)
|
static |
Get/create singleton factory.
Return a pointer to the MpCodecFactory singleton object, creating it if necessary
|
static |
Deinitialize all static codecs and freeing handle. Should be called only mpShutdown()
OsStatus loadDynCodec | ( | const char * | name | ) |
Load specified codec plugin.
OsStatus loadAllDynCodecs | ( | const char * | path, |
const char * | regexFilter | ||
) |
Load all codec plugins within specified path and filter.
Load all libs in given plugins directory.
OS_SUCCESS | - if at least one codec plugin was found. Note, that OS_SUCCESS is returned even if loading of found plugins failed. |
OS_FAILED | - if no codec plugins were found. |
|
static |
Add static codec to factory.
OsStatus createDecoder | ( | const UtlString & | mime, |
const UtlString & | fmtp, | ||
int | sampleRate, | ||
int | numChannels, | ||
int | payloadType, | ||
MpDecoderBase *& | rpDecoder | ||
) | const |
Returns a new instance of a decoder of the indicated type.
[in] | mime | - codec MIME-subtype |
[in] | fmtp | - codec-specific string in format of SDP "fmtp" parameter |
[in] | sampleRate | - requested codec's sample rate |
[in] | numChannels | - requested codec's number of channels |
[in] | payloadType | - RTP payload type to be associated with this decoder |
[out] | rpDecoder | - Reference to a pointer to the new decoder object |
OsStatus createEncoder | ( | const UtlString & | mime, |
const UtlString & | fmtp, | ||
int | sampleRate, | ||
int | numChannels, | ||
int | payloadType, | ||
MpEncoderBase *& | rpEncoder | ||
) | const |
Returns a new instance of an encoder of the indicated type.
[in] | mime | - codec MIME-subtype |
[in] | fmtp | - codec-specific string in format of SDP "fmtp" parameter |
[in] | sampleRate | - requested codec's sample rate |
[in] | numChannels | - requested codec's number of channels |
[in] | payloadType | - RTP payload type to be associated with this encoder |
[out] | rpEncoder | - Reference to a pointer to the new encoder object |
void getCodecInfoArray | ( | unsigned & | count, |
const MppCodecInfoV1_1 **& | codecInfoArray | ||
) | const |
Get list of all codecs' info.
[out] | count | - number of elements returned in codecInfoArray array. |
[out] | codecInfoArray | - array of pointers to codecs' info. |
void addCodecsToList | ( | SdpCodecList & | codecList | ) | const |
Add all supported codecs to SDP descriptions list.
|
protected |
Search codec by given MIME-subtype, sample rate and channels number.
|
protected |
Deinitialize all dynamic codecs. Should be called only from mpShutdown()
|
protected |
Initialize all static codecs.
|
staticprotected |
Freeing internal data of static codecs. Should be called only from global .dtor.
|
private |
Add new codec wrapper to codec list.
|
private |
Update cached array of MIME-types of loaded codecs.
|
private |
Assignment operator (not supported)
|
private |
List of all known and workable codecs.
|
mutableprivate |
Should we rebuild MIME-subtypes cache?
|
mutableprivate |
Number of elements in mpMimeTypesCache.
|
mutableprivate |
This is used as return value of getMimeTypes().
Cached array of MIME-subtypes of loaded codecs.
|
staticprivate |
Pointer to the singleton instance.
|
staticprivate |
Semaphore used to synchronize singleton construction and destruction.
|
staticprivate |
Filled by global magic .ctor.
List of all static codecs.