OPAL
Version 3.10.4
|
#include <opalplugin.hpp>
Public Member Functions | |
virtual | ~PluginCodec () |
virtual bool | Construct () |
Complete construction of the plug in codec. | |
virtual bool | Transcode (const void *fromPtr, unsigned &fromLen, void *toPtr, unsigned &toLen, unsigned &flags)=0 |
Convert from one media format to another. | |
virtual bool | GetStatistics (char *, unsigned) |
Gather any statistics as a string into the provide buffer. | |
virtual size_t | GetOutputDataSize () |
Get the required output buffer size to be passed into Transcode. | |
virtual bool | SetInstanceID (const char *, unsigned) |
virtual bool | SetOptions (const char *const *options) |
Set all the options for the codec. | |
virtual bool | OnChangedOptions () |
Callback for if any options are changed. | |
virtual bool | SetOption (const char *optionName, const char *optionValue) |
Set an individual option of teh given name. | |
template<typename T > | |
bool | SetOptionUnsigned (T &oldValue, const char *optionValue, unsigned minimum, unsigned maximum=UINT_MAX) |
bool | SetOptionUnsigned (unsigned &oldValue, const char *optionValue, unsigned minimum, unsigned maximum=UINT_MAX) |
template<typename T > | |
bool | SetOptionBoolean (T &oldValue, const char *optionValue) |
bool | SetOptionBoolean (bool &oldValue, const char *optionValue) |
bool | SetOptionBit (int &oldValue, unsigned bit, const char *optionValue) |
bool | SetOptionBit (unsigned &oldValue, unsigned bit, const char *optionValue) |
Static Public Member Functions | |
static bool | Terminate () |
template<class CodecClass > | |
static void * | Create (const PluginCodec_Definition *defn) |
static void | Destroy (const PluginCodec_Definition *, void *context) |
static int | Transcode (const PluginCodec_Definition *, void *context, const void *fromPtr, unsigned *fromLen, void *toPtr, unsigned *toLen, unsigned int *flags) |
static int | GetOutputDataSize (const PluginCodec_Definition *, void *context, const char *, void *, unsigned *) |
static int | ToNormalised (const PluginCodec_Definition *defn, void *, const char *, void *parm, unsigned *len) |
static int | ToCustomised (const PluginCodec_Definition *defn, void *, const char *, void *parm, unsigned *len) |
static int | FreeOptions (const PluginCodec_Definition *, void *, const char *, void *parm, unsigned *len) |
static int | GetOptions (const struct PluginCodec_Definition *codec, void *, const char *, void *parm, unsigned *len) |
static int | SetOptions (const PluginCodec_Definition *, void *context, const char *, void *parm, unsigned *len) |
static int | ValidForProtocol (const PluginCodec_Definition *defn, void *, const char *, void *parm, unsigned *len) |
static int | SetInstanceID (const PluginCodec_Definition *, void *context, const char *, void *parm, unsigned *len) |
static int | GetStatistics (const PluginCodec_Definition *, void *context, const char *, void *parm, unsigned *len) |
static int | Terminate (const PluginCodec_Definition *, void *context, const char *, void *, unsigned *) |
static struct PluginCodec_ControlDefn * | GetControls () |
Protected Member Functions | |
PluginCodec (const PluginCodec_Definition *defn) | |
Protected Attributes | |
const PluginCodec_Definition * | m_definition |
bool | m_optionsSame |
unsigned | m_maxBitRate |
unsigned | m_frameTime |
PluginCodec< NAME >::PluginCodec | ( | const PluginCodec_Definition * | defn | ) | [inline, protected] |
virtual PluginCodec< NAME >::~PluginCodec | ( | ) | [inline, virtual] |
virtual bool PluginCodec< NAME >::Construct | ( | ) | [inline, virtual] |
Complete construction of the plug in codec.
static void* PluginCodec< NAME >::Create | ( | const PluginCodec_Definition * | defn | ) | [inline, static] |
References PTRACE.
static void PluginCodec< NAME >::Destroy | ( | const PluginCodec_Definition * | , |
void * | context | ||
) | [inline, static] |
static int PluginCodec< NAME >::FreeOptions | ( | const PluginCodec_Definition * | , |
void * | , | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
Referenced by PluginCodec< NAME >::GetControls().
static struct PluginCodec_ControlDefn* PluginCodec< NAME >::GetControls | ( | ) | [inline, static, read] |
References PluginCodec< NAME >::FreeOptions(), PluginCodec< NAME >::GetOptions(), PluginCodec< NAME >::GetOutputDataSize(), PluginCodec< NAME >::GetStatistics(), PLUGINCODEC_CONTROL_FREE_CODEC_OPTIONS, PLUGINCODEC_CONTROL_GET_CODEC_OPTIONS, PLUGINCODEC_CONTROL_GET_OUTPUT_DATA_SIZE, PLUGINCODEC_CONTROL_GET_STATISTICS, PLUGINCODEC_CONTROL_LOG_FUNCTION_INC, PLUGINCODEC_CONTROL_SET_CODEC_OPTIONS, PLUGINCODEC_CONTROL_SET_INSTANCE_ID, PLUGINCODEC_CONTROL_TERMINATE_CODEC, PLUGINCODEC_CONTROL_TO_CUSTOMISED_OPTIONS, PLUGINCODEC_CONTROL_TO_NORMALISED_OPTIONS, PLUGINCODEC_CONTROL_VALID_FOR_PROTOCOL, PluginCodec< NAME >::SetInstanceID(), PluginCodec< NAME >::SetOptions(), PluginCodec< NAME >::Terminate(), PluginCodec< NAME >::ToCustomised(), PluginCodec< NAME >::ToNormalised(), and PluginCodec< NAME >::ValidForProtocol().
static int PluginCodec< NAME >::GetOptions | ( | const struct PluginCodec_Definition * | codec, |
void * | , | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec_GetCodecFunction::userData.
Referenced by PluginCodec< NAME >::GetControls().
virtual size_t PluginCodec< NAME >::GetOutputDataSize | ( | ) | [inline, virtual] |
Get the required output buffer size to be passed into Transcode.
Referenced by PluginCodec< NAME >::GetControls().
static int PluginCodec< NAME >::GetOutputDataSize | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const char * | , | ||
void * | , | ||
unsigned * | |||
) | [inline, static] |
virtual bool PluginCodec< NAME >::GetStatistics | ( | char * | , |
unsigned | |||
) | [inline, virtual] |
Gather any statistics as a string into the provide buffer.
Referenced by PluginCodec< NAME >::GetControls(), and PluginCodec< NAME >::GetStatistics().
static int PluginCodec< NAME >::GetStatistics | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec< NAME >::GetStatistics().
virtual bool PluginCodec< NAME >::OnChangedOptions | ( | ) | [inline, virtual] |
Callback for if any options are changed.
Referenced by PluginCodec< NAME >::SetOptions().
virtual bool PluginCodec< NAME >::SetInstanceID | ( | const char * | , |
unsigned | |||
) | [inline, virtual] |
Set the instance ID for the codec. This is used to match up the encode and decoder pairs of instances for a given call. While most codecs like G.723.1 are purely unidirectional, some a bidirectional and have information flow between encoder and decoder.
Referenced by PluginCodec< NAME >::GetControls(), and PluginCodec< NAME >::SetInstanceID().
static int PluginCodec< NAME >::SetInstanceID | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec< NAME >::SetInstanceID().
virtual bool PluginCodec< NAME >::SetOption | ( | const char * | optionName, |
const char * | optionValue | ||
) | [inline, virtual] |
Set an individual option of teh given name.
References PluginCodec_GetCodecFunction::bitsPerSec, PluginCodec< NAME >::m_definition, PluginCodec< NAME >::m_frameTime, PluginCodec< NAME >::m_maxBitRate, PLUGINCODEC_OPTION_FRAME_TIME, PLUGINCODEC_OPTION_TARGET_BIT_RATE, PluginCodec_GetCodecFunction::sampleRate, and PluginCodec< NAME >::SetOptionUnsigned().
Referenced by PluginCodec< NAME >::SetOptions().
bool PluginCodec< NAME >::SetOptionBit | ( | int & | oldValue, |
unsigned | bit, | ||
const char * | optionValue | ||
) | [inline] |
bool PluginCodec< NAME >::SetOptionBit | ( | unsigned & | oldValue, |
unsigned | bit, | ||
const char * | optionValue | ||
) | [inline] |
References PluginCodec< NAME >::m_optionsSame.
bool PluginCodec< NAME >::SetOptionBoolean | ( | T & | oldValue, |
const char * | optionValue | ||
) | [inline] |
bool PluginCodec< NAME >::SetOptionBoolean | ( | bool & | oldValue, |
const char * | optionValue | ||
) | [inline] |
References PluginCodec< NAME >::m_optionsSame.
virtual bool PluginCodec< NAME >::SetOptions | ( | const char *const * | options | ) | [inline, virtual] |
Set all the options for the codec.
References PluginCodec< NAME >::m_optionsSame, PluginCodec< NAME >::OnChangedOptions(), PTRACE, and PluginCodec< NAME >::SetOption().
Referenced by PluginCodec< NAME >::GetControls(), and PluginCodec< NAME >::SetOptions().
static int PluginCodec< NAME >::SetOptions | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec< NAME >::SetOptions().
bool PluginCodec< NAME >::SetOptionUnsigned | ( | T & | oldValue, |
const char * | optionValue, | ||
unsigned | minimum, | ||
unsigned | maximum = UINT_MAX |
||
) | [inline] |
Referenced by PluginCodec< NAME >::SetOption().
bool PluginCodec< NAME >::SetOptionUnsigned | ( | unsigned & | oldValue, |
const char * | optionValue, | ||
unsigned | minimum, | ||
unsigned | maximum = UINT_MAX |
||
) | [inline] |
References PluginCodec< NAME >::m_optionsSame.
static bool PluginCodec< NAME >::Terminate | ( | ) | [inline, static] |
Terminate operation of plug in codec. This is generally not needed but sometimes (e.g. fax) there is some clean up required to be done on completion of the codec run.
Referenced by PluginCodec< NAME >::GetControls(), and PluginCodec< NAME >::Terminate().
static int PluginCodec< NAME >::Terminate | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const char * | , | ||
void * | , | ||
unsigned * | |||
) | [inline, static] |
References PluginCodec< NAME >::Terminate().
static int PluginCodec< NAME >::ToCustomised | ( | const PluginCodec_Definition * | defn, |
void * | , | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec_MediaFormat::ToCustomised(), and PluginCodec_GetCodecFunction::userData.
Referenced by PluginCodec< NAME >::GetControls().
static int PluginCodec< NAME >::ToNormalised | ( | const PluginCodec_Definition * | defn, |
void * | , | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec_MediaFormat::ToNormalised(), and PluginCodec_GetCodecFunction::userData.
Referenced by PluginCodec< NAME >::GetControls().
virtual bool PluginCodec< NAME >::Transcode | ( | const void * | fromPtr, |
unsigned & | fromLen, | ||
void * | toPtr, | ||
unsigned & | toLen, | ||
unsigned & | flags | ||
) | [pure virtual] |
Convert from one media format to another.
static int PluginCodec< NAME >::Transcode | ( | const PluginCodec_Definition * | , |
void * | context, | ||
const void * | fromPtr, | ||
unsigned * | fromLen, | ||
void * | toPtr, | ||
unsigned * | toLen, | ||
unsigned int * | flags | ||
) | [inline, static] |
References PTRACE.
static int PluginCodec< NAME >::ValidForProtocol | ( | const PluginCodec_Definition * | defn, |
void * | , | ||
const char * | , | ||
void * | parm, | ||
unsigned * | len | ||
) | [inline, static] |
References PluginCodec_GetCodecFunction::userData.
Referenced by PluginCodec< NAME >::GetControls().
const PluginCodec_Definition* PluginCodec< NAME >::m_definition [protected] |
Referenced by PluginCodec< NAME >::SetOption().
unsigned PluginCodec< NAME >::m_frameTime [protected] |
Referenced by PluginCodec< NAME >::SetOption().
unsigned PluginCodec< NAME >::m_maxBitRate [protected] |
Referenced by PluginCodec< NAME >::SetOption().
bool PluginCodec< NAME >::m_optionsSame [protected] |