opalplugin.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
#ifndef __OPAL_H323PLUGIN_H
00072
#define __OPAL_H323PLUGIN_H
00073
00074
#ifdef __cplusplus
00075
extern "C" {
00076
#endif
00077
00078
#include <time.h>
00079
00080
#ifdef _WIN32
00081
# ifdef PLUGIN_CODEC_DLL_EXPORTS
00082
# define PLUGIN_CODEC_DLL_API __declspec(dllexport)
00083
# else
00084
# define PLUGIN_CODEC_DLL_API __declspec(dllimport)
00085
# endif
00086
00087
#else
00088
00089 #define PLUGIN_CODEC_DLL_API
00090
00091
#endif
00092
00093 #define PWLIB_PLUGIN_API_VERSION 0
00094 #define PLUGIN_CODEC_VERSION 1
00095
00096 #define PLUGIN_CODEC_API_VER_FN PWLibPlugin_GetAPIVersion
00097 #define PLUGIN_CODEC_API_VER_FN_STR "PWLibPlugin_GetAPIVersion"
00098
00099 #define PLUGIN_CODEC_GET_CODEC_FN OpalCodecPlugin_GetCodecs
00100 #define PLUGIN_CODEC_GET_CODEC_FN_STR "OpalCodecPlugin_GetCodecs"
00101
00102 #define PLUGIN_CODEC_API_VER_FN_DECLARE \
00103
PLUGIN_CODEC_DLL_API unsigned int PLUGIN_CODEC_API_VER_FN() \
00104
{ return PWLIB_PLUGIN_API_VERSION; }
00105
00106
enum {
00107
PluginCodec_Licence_None = 0,
00108
PluginCodec_License_GPL = 1,
00109
PluginCodec_License_MPL = 2,
00110
PluginCodec_License_Freeware = 3,
00111
PluginCodec_License_ResearchAndDevelopmentUseOnly = 4,
00112
PluginCodec_License_BSD = 5,
00113
00114
PluginCodec_License_NoRoyalties = 0x7f,
00115
00116
00117
PluginCodec_License_RoyaltiesRequired = 0x80
00118 };
00119
00120 struct PluginCodec_information {
00121
00122 time_t
timestamp;
00123
00124 const char *
sourceAuthor;
00125 const char *
sourceVersion;
00126 const char *
sourceEmail;
00127 const char *
sourceURL;
00128 const char *
sourceCopyright;
00129 const char *
sourceLicense;
00130 unsigned char sourceLicenseCode;
00131
00132 const char *
codecDescription;
00133 const char *
codecAuthor;
00134 const char *
codecVersion;
00135 const char *
codecEmail;
00136 const char *
codecURL;
00137 const char *
codecCopyright;
00138 const char *
codecLicense;
00139 unsigned short codecLicenseCode;
00140
00141
00142 };
00143
00144 enum PluginCodec_Flags {
00145
PluginCodec_MediaTypeMask = 0x000f,
00146
PluginCodec_MediaTypeAudio = 0x0000,
00147
PluginCodec_MediaTypeVideo = 0x0001,
00148
PluginCodec_MediaTypeAudioStreamed = 0x0002,
00149
00150
PluginCodec_InputTypeMask = 0x0010,
00151
PluginCodec_InputTypeRaw = 0x0000,
00152
PluginCodec_InputTypeRTP = 0x0010,
00153
00154
PluginCodec_OutputTypeMask = 0x0020,
00155
PluginCodec_OutputTypeRaw = 0x0000,
00156
PluginCodec_OutputTypeRTP = 0x0020,
00157
00158
PluginCodec_RTPTypeMask = 0x0040,
00159
PluginCodec_RTPTypeDynamic = 0x0000,
00160
PluginCodec_RTPTypeExplicit = 0x0040,
00161
00162
PluginCodec_BitsPerSamplePos = 12,
00163
PluginCodec_BitsPerSampleMask = 0xf000,
00164 };
00165
00166
struct PluginCodec_Definition;
00167
00168 struct PluginCodec_ControlDefn {
00169 const char *
name;
00170 int (*control)(
const struct PluginCodec_Definition * codec,
void * context,
00171
const char *
name,
void * parm,
unsigned * parmLen);
00172
00173 };
00174
00175 struct PluginCodec_Definition {
00176 unsigned int version;
00177
00178
00179 struct PluginCodec_information *
info;
00180
00181 unsigned int flags;
00182
00183
00184
00185
00186 const char *
descr;
00187
00188 const char *
sourceFormat;
00189 const char *
destFormat;
00190
00191 const void *
userData;
00192
00193 unsigned int sampleRate;
00194 unsigned int bitsPerSec;
00195 unsigned int nsPerFrame;
00196 unsigned int samplesPerFrame;
00197 unsigned int bytesPerFrame;
00198 unsigned int recommendedFramesPerPacket;
00199 unsigned int maxFramesPerPacket;
00200
00201 unsigned char rtpPayload;
00202 const char *
sdpFormat;
00203
00204
void * (*createCodec)(
const struct PluginCodec_Definition * codec);
00205 void (*destroyCodec) (
const struct PluginCodec_Definition * codec,
void * context);
00206 int (*codecFunction) (
const struct PluginCodec_Definition * codec,
void * context,
00207
const void * from,
unsigned * fromLen,
00208
void * to,
unsigned * toLen,
00209
unsigned int * flag);
00210 struct PluginCodec_ControlDefn *
codecControls;
00211
00212
00213 unsigned char h323CapabilityType;
00214 void *
h323CapabilityData;
00215
00216
00217 };
00218
00219 typedef struct PluginCodec_Definition * (* PluginCodec_GetCodecFunction)(
unsigned int *,
unsigned int);
00220 typedef unsigned (*
PluginCodec_GetAPIVersionFunction)();
00221
00223
00224
00225
00226
00227
00228 struct PluginCodec_H323CapabilityExtension {
00229 unsigned int index;
00230 void *
data;
00231 unsigned dataLength;
00232 };
00233
00234 struct PluginCodec_H323NonStandardCodecData {
00235 const char *
objectId;
00236 unsigned char t35CountryCode;
00237 unsigned char t35Extension;
00238 unsigned short manufacturerCode;
00239 const unsigned char *
data;
00240 unsigned int dataLength;
00241 int (*capabilityMatchFunction)(
struct PluginCodec_H323NonStandardCodecData *);
00242 };
00243
00244 struct PluginCodec_H323AudioGSMData {
00245 int comfortNoise:1;
00246 int scrambled:1;
00247 };
00248
00249 struct PluginCodec_H323AudioG7231AnnexC {
00250 unsigned char maxAl_sduAudioFrames;
00251 int silenceSuppression:1;
00252 int highRateMode0:6;
00253 int highRateMode1:6;
00254 int lowRateMode0:6;
00255 int lowRateMode1:6;
00256 int sidMode0:4;
00257 int sidMode1:4;
00258 };
00259
00260 struct PluginCodec_H323VideoH261
00261 {
00262 int qcifMPI:2;
00263 int cifMPI:2;
00264 int temporalSpatialTradeOffCapability;
00265 int maxBitRate;
00266 int stillImageTransmission:1;
00267 int videoBadMBsCap:1;
00268 const struct PluginCodec_H323CapabilityExtension *
extensions;
00269 };
00270
00271
enum {
00272
PluginCodec_H323Codec_undefined,
00273
PluginCodec_H323Codec_programmed,
00274
PluginCodec_H323Codec_nonStandard,
00275
PluginCodec_H323Codec_generic,
00276
00277
00278
PluginCodec_H323AudioCodec_g711Alaw_64k,
00279
PluginCodec_H323AudioCodec_g711Alaw_56k,
00280
PluginCodec_H323AudioCodec_g711Ulaw_64k,
00281
PluginCodec_H323AudioCodec_g711Ulaw_56k,
00282
PluginCodec_H323AudioCodec_g722_64k,
00283
PluginCodec_H323AudioCodec_g722_56k,
00284
PluginCodec_H323AudioCodec_g722_48k,
00285
PluginCodec_H323AudioCodec_g7231,
00286
PluginCodec_H323AudioCodec_g728,
00287
PluginCodec_H323AudioCodec_g729,
00288
PluginCodec_H323AudioCodec_g729AnnexA,
00289
PluginCodec_H323AudioCodec_is11172,
00290
PluginCodec_H323AudioCodec_is13818Audio,
00291
PluginCodec_H323AudioCodec_g729wAnnexB,
00292
PluginCodec_H323AudioCodec_g729AnnexAwAnnexB,
00293
PluginCodec_H323AudioCodec_g7231AnnexC,
00294
PluginCodec_H323AudioCodec_gsmFullRate,
00295
PluginCodec_H323AudioCodec_gsmHalfRate,
00296
PluginCodec_H323AudioCodec_gsmEnhancedFullRate,
00297
PluginCodec_H323AudioCodec_g729Extensions,
00298
00299
00300
PluginCodec_H323VideoCodec_h261,
00301
PluginCodec_H323VideoCodec_h262,
00302
PluginCodec_H323VideoCodec_h263,
00303
PluginCodec_H323VideoCodec_is11172,
00304 };
00305
00306
00307
00308
#ifdef OPAL_STATIC_CODEC
00309
00310
# undef PLUGIN_CODEC_DLL_API
00311
# define PLUGIN_CODEC_DLL_API static
00312
# define PLUGIN_CODEC_IMPLEMENT(name) \
00313
unsigned int Opal_StaticCodec_##name##_GetAPIVersion() \
00314
{ return PWLIB_PLUGIN_API_VERSION; } \
00315
static struct PluginCodec_Definition * PLUGIN_CODEC_GET_CODEC_FN(unsigned * count, unsigned ); \
00316 struct PluginCodec_Definition * Opal_StaticCodec_##name##_GetCodecs(unsigned * p1, unsigned p2) \
00317 { return PLUGIN_CODEC_GET_CODEC_FN(p1,p2); } \
00318
00319
#else
00320
00321 # define PLUGIN_CODEC_IMPLEMENT(name) \
00322
PLUGIN_CODEC_DLL_API unsigned int PLUGIN_CODEC_API_VER_FN() \
00323
{ return PWLIB_PLUGIN_API_VERSION; } \
00324
00325
#endif
00326
00327
#ifdef __cplusplus
00328
};
00329
#endif
00330
00331
#endif
Generated on Sat Jul 24 17:03:36 2004 for OpenH323 by
1.3.7