sipxmedialib  Version 3.3
Classes | Macros | Typedefs | Functions
PlgDefsV1.h File Reference
#include <string.h>
#include <ctype.h>
#include "mp/RtpHeader.h"
Include dependency graph for PlgDefsV1.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MppCodecInfoV1_1
 Generic information about codec. More...
 
struct  MppCodecFmtpInfoV1_2
 Information about concrete codec instance (i.e. with selected fmtp). More...
 

Macros

#define CODEC_DYNAMIC
 
#define CODEC_API
 
#define FALSE   (0!=0)
 
#define TRUE   (0==0)
 
#define DECLARE_FUNCS_V1(x)
 
#define CPP_DECLARE_FUNCS_V1(x)   extern "C" DECLARE_FUNCS_V1(x)
 
#define PLG_GET_CODEC_NAME   get_codecs_v1
 
#define PLG_GET_INFO_V1_1(x)   x##_get_info_v1_1
 
#define PLG_INIT_V1_2(x)   x##_init_v1_2
 
#define PLG_GET_PACKET_SAMPLES_V1_2(x)   x##_get_packet_samples_v1_2
 
#define PLG_DECODE_V1(x)   x##_decode_v1
 
#define PLG_ENCODE_V1(x)   x##_encode_v1
 
#define PLG_FREE_V1(x)   x##_free_v1
 
#define PLG_SIGNALING_V1(x)   x##_signaling_v1
 
#define MSK_GET_CODEC_NAME_V1   "get_codecs_v1"
 
#define MSK_GET_INFO_V1_1   "_get_info_v1_1"
 
#define MSK_INIT_V1_2   "_init_v1_2"
 
#define MSK_GET_PACKET_SAMPLES_V1_2   "_get_packet_samples_v1_2"
 
#define MSK_DECODE_V1   "_decode_v1"
 
#define MSK_ENCODE_V1   "_encode_v1"
 
#define MSK_FREE_V1   "_free_v1"
 
#define MSK_SIGNALING_V1   "_signaling_v1"
 
#define IPLG_ENUM_CODEC_NAME   plugin_enum_codec
 
#define IPLG_ENUM_CODEC_START   static const char* IPLG_ENUM_CODEC_NAME [] = {
 
#define IPLG_ENUM_CODEC(x)   #x ,
 
#define IPLG_ENUM_CODEC_END   NULL};
 
#define IPLG_ENUM_CODEC_FUNC
 
#define DEFINE_STATIC_REGISTRATOR
 
#define REG_STATIC_NAME(y)   registerStatic_##y
 
#define REGISTER_STATIC_PLG(x)
 
#define SPLG_ENUM_CODEC_START(y)   void REG_STATIC_NAME(y) (void) {
 
#define SPLG_ENUM_CODEC(x)
 
#define SPLG_ENUM_CODEC_SPECIAL_PACKING(x)   PLG_GET_PACKET_SAMPLES_V1_2(x),
 
#define SPLG_ENUM_CODEC_NO_SPECIAL_PACKING(x)   NULL,
 
#define SPLG_ENUM_CODEC_SIGNALING(x)   PLG_SIGNALING_V1(x));
 
#define SPLG_ENUM_CODEC_NO_SIGNALING(x)   NULL);
 
#define SPLG_ENUM_CODEC_END   }
 
#define PLG_ENUM_CODEC_START(y)   IPLG_ENUM_CODEC_START
 
#define PLG_ENUM_CODEC(x)   IPLG_ENUM_CODEC(x)
 
#define PLG_ENUM_CODEC_SPECIAL_PACKING(x)
 
#define PLG_ENUM_CODEC_NO_SPECIAL_PACKING(x)
 
#define PLG_ENUM_CODEC_SIGNALING(x)
 
#define PLG_ENUM_CODEC_NO_SIGNALING(x)
 
#define PLG_ENUM_CODEC_END
 
#define PLG_SINGLE_CODEC_SIG(x)
 
#define PLG_SINGLE_CODEC(x)
 
#define PLG_DOUBLE_CODECS(x, y)
 
#define SIZE_OF_SAMPLE   2
 
#define SIZE_OF_SAMPLE_BITS   (SIZE_OF_SAMPLE * 8)
 
#define PLG_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define PLG_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 
Constants for plgCodecStaticInfoV1::codecType values.
#define CODEC_TYPE_FRAME_BASED   0
 Codec is frame based (like GSM, iLBC, etc). More...
 
#define CODEC_TYPE_SAMPLE_BASED   1
 Codec is sample based (like G.711, G.726, etc). More...
 
Constants for plgCodecStaticInfoV1::framePacking values.
#define CODEC_FRAME_PACKING_NONE   0
 Frames could be simply concatenated (like GSM, iLBC, etc). More...
 
#define CODEC_FRAME_PACKING_SPECIAL   1
 
Constants for plgCodecStaticInfoV1::packetLossConcealment values.
#define CODEC_PLC_NONE   0
 Codec need external PLC. More...
 
#define CODEC_PLC_INTERNAL   1
 Codec have internal PLC. More...
 
Constants for plgCodecStaticInfoV1::vadCng values.
#define CODEC_CNG_NONE   0
 Codec need external PLC. More...
 
#define CODEC_CNG_INTERNAL   1
 Codec have internal PLC. More...
 
Return codes for API functions
#define RPLG_SUCCESS   0
 
#define RPLG_INVALID_ARGUMENT   (-1)
 
#define RPLG_FAILED   (-2)
 
#define RPLG_NOT_SUPPORTED   (-3)
 
#define RPLG_CORRUPTED_DATA   (-4)
 Encoded data is corrupted. More...
 
#define RPLG_BAD_HANDLE   (-5)
 
#define RPLG_NO_MORE_DATA   (-6)
 
#define RPLG_BUFFER_TOO_SMALL   (-7)
 is too small for output data. More...
 
Values for PLG_INIT_V1() and PLG_FREE_V1() isDecoder argument
#define CODEC_DECODER   1
 
#define CODEC_ENCODER   0
 

Typedefs

typedef int(* dlGetCodecsV1) (int iNum, const char **pCodecModuleName)
 
typedef int(* dlPlgGetInfoV1_1) (const struct MppCodecInfoV1_1 **codecInfo)
 
typedef void *(* dlPlgInitV1_2) (const char *fmtp, int isDecoder, struct MppCodecFmtpInfoV1_2 *pCodecFmtpInfo)
 
typedef int(* dlPlgGetSignalingDataV1) (void *handle, uint32_t *outEvent, uint32_t *outDuration, uint32_t *startStatus, uint32_t *stopStatus)
 
typedef int(* dlPlgGetPacketSamplesV1_2) (void *handle, const uint8_t *pPacketData, unsigned packetSize, unsigned *pNumSamples, const struct RtpHeader *pRtpHeader)
 
typedef int(* dlPlgDecodeV1) (void *handle, const void *pCodedData, unsigned cbCodedPacketSize, void *pAudioBuffer, unsigned cbBufferSize, unsigned *pcbDecodedSize, const struct RtpHeader *pRtpHeader)
 
typedef int(* dlPlgEncodeV1) (void *handle, const void *pAudioBuffer, unsigned cbAudioSamples, int *rSamplesConsumed, void *pCodedData, unsigned cbMaxCodedData, int *pcbCodedSize, unsigned *pbSendNow)
 
typedef int(* dlPlgFreeV1) (void *handle, int isDecoder)
 
typedef int16_t audio_sample_t
 

Functions

void mppLogError (const char *format,...)
 

Macro Definition Documentation

#define CODEC_DYNAMIC
#define CODEC_API
#define FALSE   (0!=0)
#define TRUE   (0==0)
#define CODEC_TYPE_FRAME_BASED   0

Codec is frame based (like GSM, iLBC, etc).

#define CODEC_TYPE_SAMPLE_BASED   1

Codec is sample based (like G.711, G.726, etc).

#define CODEC_FRAME_PACKING_NONE   0

Frames could be simply concatenated (like GSM, iLBC, etc).

#define CODEC_FRAME_PACKING_SPECIAL   1

Codec require special processing to pack several frames in one RTP packet (like AMR, Speex, etc).

#define CODEC_PLC_NONE   0

Codec need external PLC.

#define CODEC_PLC_INTERNAL   1

Codec have internal PLC.

#define CODEC_CNG_NONE   0

Codec need external PLC.

#define CODEC_CNG_INTERNAL   1

Codec have internal PLC.

#define RPLG_SUCCESS   0
#define RPLG_INVALID_ARGUMENT   (-1)
#define RPLG_FAILED   (-2)
#define RPLG_NOT_SUPPORTED   (-3)
#define RPLG_CORRUPTED_DATA   (-4)

Encoded data is corrupted.

#define RPLG_BAD_HANDLE   (-5)
#define RPLG_NO_MORE_DATA   (-6)
#define RPLG_BUFFER_TOO_SMALL   (-7)

is too small for output data.

Encoding/decoding buffer

#define CODEC_DECODER   1
#define CODEC_ENCODER   0
#define DECLARE_FUNCS_V1 (   x)
Value:
CODEC_API int PLG_GET_INFO_V1_1(x)(const struct MppCodecInfoV1_1 **codecInfo); \
CODEC_API void* PLG_INIT_V1_2(x)(const char* fmtp, int isDecoder, \
struct MppCodecFmtpInfoV1_2* pCodecFmtpInfo); \
CODEC_API int PLG_FREE_V1(x)(void* handle, int isDecoder); \
const uint8_t* pPacketData, \
unsigned packetSize, \
unsigned *pNumSamples, \
const struct RtpHeader* pRtpHeader);\
CODEC_API int PLG_DECODE_V1(x)(void* handle, const void* pCodedData, \
unsigned cbCodedPacketSize, void* pAudioBuffer, \
unsigned cbBufferSize, unsigned *pcbDecodedSize, \
const struct RtpHeader* pRtpHeader); \
CODEC_API int PLG_ENCODE_V1(x)(void* handle, const void* pAudioBuffer, \
unsigned cbAudioSamples, int* rSamplesConsumed, \
void* pCodedData, unsigned cbMaxCodedData, \
int* pcbCodedSize, unsigned* pbSendNow);
#define PLG_DECODE_V1(x)
Definition: PlgDefsV1.h:255
#define PLG_GET_INFO_V1_1(x)
Definition: PlgDefsV1.h:252
#define CODEC_API
Definition: PlgDefsV1.h:30
#define PLG_GET_PACKET_SAMPLES_V1_2(x)
Definition: PlgDefsV1.h:254
#define PLG_FREE_V1(x)
Definition: PlgDefsV1.h:257
RTP header as described in RFC 3550.
Definition: RtpHeader.h:43
#define PLG_INIT_V1_2(x)
Definition: PlgDefsV1.h:253
Information about concrete codec instance (i.e. with selected fmtp).
Definition: PlgDefsV1.h:202
#define PLG_ENCODE_V1(x)
Definition: PlgDefsV1.h:256
Generic information about codec.
Definition: PlgDefsV1.h:169
#define CPP_DECLARE_FUNCS_V1 (   x)    extern "C" DECLARE_FUNCS_V1(x)
#define PLG_GET_CODEC_NAME   get_codecs_v1
#define PLG_GET_INFO_V1_1 (   x)    x##_get_info_v1_1
#define PLG_INIT_V1_2 (   x)    x##_init_v1_2
#define PLG_GET_PACKET_SAMPLES_V1_2 (   x)    x##_get_packet_samples_v1_2
#define PLG_DECODE_V1 (   x)    x##_decode_v1
#define PLG_ENCODE_V1 (   x)    x##_encode_v1
#define PLG_FREE_V1 (   x)    x##_free_v1
#define PLG_SIGNALING_V1 (   x)    x##_signaling_v1
#define MSK_GET_CODEC_NAME_V1   "get_codecs_v1"
#define MSK_GET_INFO_V1_1   "_get_info_v1_1"
#define MSK_INIT_V1_2   "_init_v1_2"
#define MSK_GET_PACKET_SAMPLES_V1_2   "_get_packet_samples_v1_2"
#define MSK_DECODE_V1   "_decode_v1"
#define MSK_ENCODE_V1   "_encode_v1"
#define MSK_FREE_V1   "_free_v1"
#define MSK_SIGNALING_V1   "_signaling_v1"
#define IPLG_ENUM_CODEC_NAME   plugin_enum_codec
#define IPLG_ENUM_CODEC_START   static const char* IPLG_ENUM_CODEC_NAME [] = {
#define IPLG_ENUM_CODEC (   x)    #x ,
#define IPLG_ENUM_CODEC_END   NULL};
#define IPLG_ENUM_CODEC_FUNC
Value:
CODEC_API int PLG_GET_CODEC_NAME (int iNum, const char** pCodecModuleName); /* prototype */ \
CODEC_API int PLG_GET_CODEC_NAME (int iNum, const char** pCodecModuleName) /* implementation */ \
{ \
int i = (sizeof ( IPLG_ENUM_CODEC_NAME ) / sizeof ( IPLG_ENUM_CODEC_NAME[0] )) - 1; \
if ((iNum < 0) || (iNum > i)) return RPLG_FAILED; \
*pCodecModuleName = IPLG_ENUM_CODEC_NAME [iNum]; return RPLG_SUCCESS; \
}
#define CODEC_API
Definition: PlgDefsV1.h:30
#define RPLG_FAILED
Definition: PlgDefsV1.h:81
#define RPLG_SUCCESS
Definition: PlgDefsV1.h:79
#define PLG_GET_CODEC_NAME
Definition: PlgDefsV1.h:251
#define IPLG_ENUM_CODEC_NAME
Definition: PlgDefsV1.h:289
#define DEFINE_STATIC_REGISTRATOR
Value:
void callbackRegisterStaticCodec(const char* moduleName, \
const char* codecModuleName, \
dlPlgInitV1_2 plgInit, \
dlPlgGetInfoV1_1 plgGetInfo, \
dlPlgDecodeV1 plgDecode, \
dlPlgEncodeV1 plgEncode, \
dlPlgFreeV1 plgFree, \
dlPlgGetPacketSamplesV1_2 plgGetPacketSamples, \
dlPlgGetSignalingDataV1 plgSignaling);
int(* dlPlgDecodeV1)(void *handle, const void *pCodedData, unsigned cbCodedPacketSize, void *pAudioBuffer, unsigned cbBufferSize, unsigned *pcbDecodedSize, const struct RtpHeader *pRtpHeader)
Definition: PlgDefsV1.h:280
int(* dlPlgEncodeV1)(void *handle, const void *pAudioBuffer, unsigned cbAudioSamples, int *rSamplesConsumed, void *pCodedData, unsigned cbMaxCodedData, int *pcbCodedSize, unsigned *pbSendNow)
Definition: PlgDefsV1.h:283
int(* dlPlgGetInfoV1_1)(const struct MppCodecInfoV1_1 **codecInfo)
Definition: PlgDefsV1.h:271
int(* dlPlgFreeV1)(void *handle, int isDecoder)
Definition: PlgDefsV1.h:286
int(* dlPlgGetPacketSamplesV1_2)(void *handle, const uint8_t *pPacketData, unsigned packetSize, unsigned *pNumSamples, const struct RtpHeader *pRtpHeader)
Definition: PlgDefsV1.h:275
void callbackRegisterStaticCodec(const char *moduleName, const char *codecModuleName, dlPlgInitV1_2 plgInit, dlPlgGetInfoV1_1 plgGetInfo, dlPlgDecodeV1 plgDecode, dlPlgEncodeV1 plgEncode, dlPlgFreeV1 plgFree, dlPlgGetPacketSamplesV1_2 plgGetPacketSamples, dlPlgGetSignalingDataV1 plgSignaling)
Definition: MpPlgStaffV1.cpp:18
int(* dlPlgGetSignalingDataV1)(void *handle, uint32_t *outEvent, uint32_t *outDuration, uint32_t *startStatus, uint32_t *stopStatus)
Definition: PlgDefsV1.h:273
void *(* dlPlgInitV1_2)(const char *fmtp, int isDecoder, struct MppCodecFmtpInfoV1_2 *pCodecFmtpInfo)
Definition: PlgDefsV1.h:272
#define REG_STATIC_NAME (   y)    registerStatic_##y
#define REGISTER_STATIC_PLG (   x)
Value:
void REG_STATIC_NAME(x)(void); \
#define REG_STATIC_NAME(y)
Definition: PlgDefsV1.h:313
#define SPLG_ENUM_CODEC_START (   y)    void REG_STATIC_NAME(y) (void) {
#define SPLG_ENUM_CODEC (   x)
Value:
#define PLG_DECODE_V1(x)
Definition: PlgDefsV1.h:255
#define PLG_GET_INFO_V1_1(x)
Definition: PlgDefsV1.h:252
#define PLG_FREE_V1(x)
Definition: PlgDefsV1.h:257
#define PLG_INIT_V1_2(x)
Definition: PlgDefsV1.h:253
#define PLG_ENCODE_V1(x)
Definition: PlgDefsV1.h:256
void callbackRegisterStaticCodec(const char *moduleName, const char *codecModuleName, dlPlgInitV1_2 plgInit, dlPlgGetInfoV1_1 plgGetInfo, dlPlgDecodeV1 plgDecode, dlPlgEncodeV1 plgEncode, dlPlgFreeV1 plgFree, dlPlgGetPacketSamplesV1_2 plgGetPacketSamples, dlPlgGetSignalingDataV1 plgSignaling)
Definition: MpPlgStaffV1.cpp:18
#define SPLG_ENUM_CODEC_SPECIAL_PACKING (   x)    PLG_GET_PACKET_SAMPLES_V1_2(x),
#define SPLG_ENUM_CODEC_NO_SPECIAL_PACKING (   x)    NULL,
#define SPLG_ENUM_CODEC_SIGNALING (   x)    PLG_SIGNALING_V1(x));
#define SPLG_ENUM_CODEC_NO_SIGNALING (   x)    NULL);
#define SPLG_ENUM_CODEC_END   }
#define PLG_ENUM_CODEC_START (   y)    IPLG_ENUM_CODEC_START
#define PLG_ENUM_CODEC (   x)    IPLG_ENUM_CODEC(x)
#define PLG_ENUM_CODEC_SPECIAL_PACKING (   x)
#define PLG_ENUM_CODEC_NO_SPECIAL_PACKING (   x)
#define PLG_ENUM_CODEC_SIGNALING (   x)
#define PLG_ENUM_CODEC_NO_SIGNALING (   x)
#define PLG_ENUM_CODEC_END
Value:
#define IPLG_ENUM_CODEC_FUNC
Definition: PlgDefsV1.h:293
#define PLG_SINGLE_CODEC_SIG (   x)
Value:
PLG_ENUM_CODEC_SIG(x) \
#define PLG_ENUM_CODEC_END
Definition: PlgDefsV1.h:344
#define PLG_ENUM_CODEC_START(y)
Definition: PlgDefsV1.h:338
#define PLG_SINGLE_CODEC (   x)
Value:
#define PLG_ENUM_CODEC_END
Definition: PlgDefsV1.h:344
#define PLG_ENUM_CODEC_START(y)
Definition: PlgDefsV1.h:338
#define PLG_ENUM_CODEC(x)
Definition: PlgDefsV1.h:339
#define PLG_DOUBLE_CODECS (   x,
 
)
Value:
#define PLG_ENUM_CODEC_END
Definition: PlgDefsV1.h:344
#define PLG_ENUM_CODEC_START(y)
Definition: PlgDefsV1.h:338
#define PLG_ENUM_CODEC(x)
Definition: PlgDefsV1.h:339
#define SIZE_OF_SAMPLE   2
#define SIZE_OF_SAMPLE_BITS   (SIZE_OF_SAMPLE * 8)
#define PLG_MAX (   a,
 
)    (((a) > (b)) ? (a) : (b))
#define PLG_MIN (   a,
 
)    (((a) < (b)) ? (a) : (b))

Typedef Documentation

typedef int(* dlGetCodecsV1) (int iNum, const char **pCodecModuleName)
typedef int(* dlPlgGetInfoV1_1) (const struct MppCodecInfoV1_1 **codecInfo)
typedef void*(* dlPlgInitV1_2) (const char *fmtp, int isDecoder, struct MppCodecFmtpInfoV1_2 *pCodecFmtpInfo)
typedef int(* dlPlgGetSignalingDataV1) (void *handle, uint32_t *outEvent, uint32_t *outDuration, uint32_t *startStatus, uint32_t *stopStatus)
typedef int(* dlPlgGetPacketSamplesV1_2) (void *handle, const uint8_t *pPacketData, unsigned packetSize, unsigned *pNumSamples, const struct RtpHeader *pRtpHeader)
typedef int(* dlPlgDecodeV1) (void *handle, const void *pCodedData, unsigned cbCodedPacketSize, void *pAudioBuffer, unsigned cbBufferSize, unsigned *pcbDecodedSize, const struct RtpHeader *pRtpHeader)
typedef int(* dlPlgEncodeV1) (void *handle, const void *pAudioBuffer, unsigned cbAudioSamples, int *rSamplesConsumed, void *pCodedData, unsigned cbMaxCodedData, int *pcbCodedSize, unsigned *pbSendNow)
typedef int(* dlPlgFreeV1) (void *handle, int isDecoder)
typedef int16_t audio_sample_t

Function Documentation

void mppLogError ( const char *  format,
  ... 
)