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
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 #ifndef __OPAL_H323PLUGIN_H
00093 #define __OPAL_H323PLUGIN_H
00094
00095 #ifdef __cplusplus
00096 extern "C" {
00097 #endif
00098
00099 #include <time.h>
00100
00101 #ifdef _WIN32
00102 # ifdef PLUGIN_CODEC_DLL_EXPORTS
00103 # define PLUGIN_CODEC_DLL_API __declspec(dllexport)
00104 # else
00105 # define PLUGIN_CODEC_DLL_API __declspec(dllimport)
00106 # endif
00107
00108 #else
00109
00110 #define PLUGIN_CODEC_DLL_API
00111
00112 #endif
00113
00114 #define PWLIB_PLUGIN_API_VERSION 0
00115
00116 #define PLUGIN_CODEC_VERSION 1 // initial version
00117 #define PLUGIN_CODEC_VERSION_WIDEBAND 2 // added wideband
00118
00119 #define PLUGIN_CODEC_API_VER_FN PWLibPlugin_GetAPIVersion
00120 #define PLUGIN_CODEC_API_VER_FN_STR "PWLibPlugin_GetAPIVersion"
00121
00122 #define PLUGIN_CODEC_GET_CODEC_FN OpalCodecPlugin_GetCodecs
00123 #define PLUGIN_CODEC_GET_CODEC_FN_STR "OpalCodecPlugin_GetCodecs"
00124
00125 #define PLUGIN_CODEC_API_VER_FN_DECLARE \
00126 PLUGIN_CODEC_DLL_API unsigned int PLUGIN_CODEC_API_VER_FN() \
00127 { return PWLIB_PLUGIN_API_VERSION; }
00128
00129 enum {
00130 PluginCodec_License_None = 0,
00131 PluginCodec_Licence_None = PluginCodec_License_None,
00132 PluginCodec_License_GPL = 1,
00133 PluginCodec_License_MPL = 2,
00134 PluginCodec_License_Freeware = 3,
00135 PluginCodec_License_ResearchAndDevelopmentUseOnly = 4,
00136 PluginCodec_License_BSD = 5,
00137
00138 PluginCodec_License_NoRoyalties = 0x7f,
00139
00140
00141 PluginCodec_License_RoyaltiesRequired = 0x80
00142 };
00143
00144 struct PluginCodec_information {
00145
00146 time_t timestamp;
00147
00148 const char * sourceAuthor;
00149 const char * sourceVersion;
00150 const char * sourceEmail;
00151 const char * sourceURL;
00152 const char * sourceCopyright;
00153 const char * sourceLicense;
00154 unsigned char sourceLicenseCode;
00155
00156 const char * codecDescription;
00157 const char * codecAuthor;
00158 const char * codecVersion;
00159 const char * codecEmail;
00160 const char * codecURL;
00161 const char * codecCopyright;
00162 const char * codecLicense;
00163 unsigned short codecLicenseCode;
00164
00165
00166 };
00167
00168 enum PluginCodec_Flags {
00169 PluginCodec_MediaTypeMask = 0x000f,
00170 PluginCodec_MediaTypeAudio = 0x0000,
00171 PluginCodec_MediaTypeVideo = 0x0001,
00172 PluginCodec_MediaTypeAudioStreamed = 0x0002,
00173
00174 PluginCodec_InputTypeMask = 0x0010,
00175 PluginCodec_InputTypeRaw = 0x0000,
00176 PluginCodec_InputTypeRTP = 0x0010,
00177
00178 PluginCodec_OutputTypeMask = 0x0020,
00179 PluginCodec_OutputTypeRaw = 0x0000,
00180 PluginCodec_OutputTypeRTP = 0x0020,
00181
00182 PluginCodec_RTPTypeMask = 0x0040,
00183 PluginCodec_RTPTypeDynamic = 0x0000,
00184 PluginCodec_RTPTypeExplicit = 0x0040,
00185
00186 PluginCodec_RTPSharedMask = 0x0080,
00187 PluginCodec_RTPTypeNotShared = 0x0000,
00188 PluginCodec_RTPTypeShared = 0x0080,
00189
00190 PluginCodec_DecodeSilenceMask = 0x0100,
00191 PluginCodec_NoDecodeSilence = 0x0000,
00192 PluginCodec_DecodeSilence = 0x0100,
00193
00194 PluginCodec_BitsPerSamplePos = 12,
00195 PluginCodec_BitsPerSampleMask = 0xf000,
00196 };
00197
00198 enum PluginCodec_CoderFlags {
00199 PluginCodec_CoderSilenceFrame = 1
00200 };
00201
00202 struct PluginCodec_Definition;
00203
00204 struct PluginCodec_ControlDefn {
00205 const char * name;
00206 int (*control)(const struct PluginCodec_Definition * codec, void * context,
00207 const char * name, void * parm, unsigned * parmLen);
00208
00209 };
00210
00211 struct PluginCodec_Definition {
00212 unsigned int version;
00213
00214
00215 struct PluginCodec_information * info;
00216
00217 unsigned int flags;
00218
00219
00220
00221
00222
00223 const char * descr;
00224
00225 const char * sourceFormat;
00226 const char * destFormat;
00227
00228 const void * userData;
00229
00230 unsigned int sampleRate;
00231 unsigned int bitsPerSec;
00232 unsigned int nsPerFrame;
00233 unsigned int samplesPerFrame;
00234 unsigned int bytesPerFrame;
00235 unsigned int recommendedFramesPerPacket;
00236 unsigned int maxFramesPerPacket;
00237
00238 unsigned char rtpPayload;
00239 const char * sdpFormat;
00240
00241 void * (*createCodec)(const struct PluginCodec_Definition * codec);
00242 void (*destroyCodec) (const struct PluginCodec_Definition * codec, void * context);
00243 int (*codecFunction) (const struct PluginCodec_Definition * codec, void * context,
00244 const void * from, unsigned * fromLen,
00245 void * to, unsigned * toLen,
00246 unsigned int * flag);
00247 struct PluginCodec_ControlDefn * codecControls;
00248
00249
00250 unsigned char h323CapabilityType;
00251 void * h323CapabilityData;
00252
00253
00254 };
00255
00256 typedef struct PluginCodec_Definition * (* PluginCodec_GetCodecFunction)(unsigned int *, unsigned int);
00257 typedef unsigned (* PluginCodec_GetAPIVersionFunction)();
00258
00260
00261
00262
00263
00264
00265 struct PluginCodec_H323CapabilityExtension {
00266 unsigned int index;
00267 void * data;
00268 unsigned dataLength;
00269 };
00270
00271 struct PluginCodec_H323NonStandardCodecData {
00272 const char * objectId;
00273 unsigned char t35CountryCode;
00274 unsigned char t35Extension;
00275 unsigned short manufacturerCode;
00276 const unsigned char * data;
00277 unsigned int dataLength;
00278 int (*capabilityMatchFunction)(struct PluginCodec_H323NonStandardCodecData *);
00279 };
00280
00281
00282 struct PluginCodec_H323GenericParameterDefinition
00283 {
00284 int collapsing;
00285 unsigned int id;
00286 enum PluginCodec_H323GenericParameterType {
00287
00288
00289
00290 PluginCodec_GenericParameter_Logical = 0,
00291 PluginCodec_GenericParameter_Bitfield,
00292 PluginCodec_GenericParameter_ShortMin,
00293 PluginCodec_GenericParameter_ShortMax,
00294 PluginCodec_GenericParameter_LongMin,
00295 PluginCodec_GenericParameter_LongMax,
00296 PluginCodec_GenericParameter_OctetString,
00297 PluginCodec_GenericParameter_GenericParameter
00298 } type;
00299 union {
00300 unsigned long integer;
00301 char *octetstring;
00302 struct PluginCodec_H323GenericParameterDefinition *genericparameter;
00303 } value;
00304 };
00305
00306
00307 struct PluginCodec_H323GenericCodecData {
00308
00309
00310
00311
00312 const char * standardIdentifier;
00313 unsigned int maxBitRate;
00314
00315
00316
00317 unsigned int nParameters;
00318
00319 const struct PluginCodec_H323GenericParameterDefinition *params;
00320 };
00321
00322 struct PluginCodec_H323AudioGSMData {
00323 int comfortNoise:1;
00324 int scrambled:1;
00325 };
00326
00327 struct PluginCodec_H323AudioG7231AnnexC {
00328 unsigned char maxAl_sduAudioFrames;
00329 int silenceSuppression:1;
00330 int highRateMode0:6;
00331 int highRateMode1:6;
00332 int lowRateMode0:6;
00333 int lowRateMode1:6;
00334 int sidMode0:4;
00335 int sidMode1:4;
00336 };
00337
00338 struct PluginCodec_H323VideoH261
00339 {
00340 int qcifMPI:2;
00341 int cifMPI:2;
00342 int temporalSpatialTradeOffCapability;
00343 int maxBitRate;
00344 int stillImageTransmission:1;
00345 int videoBadMBsCap:1;
00346 const struct PluginCodec_H323CapabilityExtension * extensions;
00347 };
00348
00349 enum {
00350 PluginCodec_H323Codec_undefined,
00351 PluginCodec_H323Codec_programmed,
00352 PluginCodec_H323Codec_nonStandard,
00353 PluginCodec_H323Codec_generic,
00354
00355
00356 PluginCodec_H323AudioCodec_g711Alaw_64k,
00357 PluginCodec_H323AudioCodec_g711Alaw_56k,
00358 PluginCodec_H323AudioCodec_g711Ulaw_64k,
00359 PluginCodec_H323AudioCodec_g711Ulaw_56k,
00360 PluginCodec_H323AudioCodec_g722_64k,
00361 PluginCodec_H323AudioCodec_g722_56k,
00362 PluginCodec_H323AudioCodec_g722_48k,
00363 PluginCodec_H323AudioCodec_g7231,
00364 PluginCodec_H323AudioCodec_g728,
00365 PluginCodec_H323AudioCodec_g729,
00366 PluginCodec_H323AudioCodec_g729AnnexA,
00367 PluginCodec_H323AudioCodec_is11172,
00368 PluginCodec_H323AudioCodec_is13818Audio,
00369 PluginCodec_H323AudioCodec_g729wAnnexB,
00370 PluginCodec_H323AudioCodec_g729AnnexAwAnnexB,
00371 PluginCodec_H323AudioCodec_g7231AnnexC,
00372 PluginCodec_H323AudioCodec_gsmFullRate,
00373 PluginCodec_H323AudioCodec_gsmHalfRate,
00374 PluginCodec_H323AudioCodec_gsmEnhancedFullRate,
00375 PluginCodec_H323AudioCodec_g729Extensions,
00376
00377
00378 PluginCodec_H323VideoCodec_h261,
00379 PluginCodec_H323VideoCodec_h262,
00380 PluginCodec_H323VideoCodec_h263,
00381 PluginCodec_H323VideoCodec_is11172,
00382 };
00383
00384
00385
00386 #ifdef OPAL_STATIC_CODEC
00387
00388 # undef PLUGIN_CODEC_DLL_API
00389 # define PLUGIN_CODEC_DLL_API static
00390 # define PLUGIN_CODEC_IMPLEMENT(name) \
00391 unsigned int Opal_StaticCodec_##name##_GetAPIVersion() \
00392 { return PWLIB_PLUGIN_API_VERSION; } \
00393 static struct PluginCodec_Definition * PLUGIN_CODEC_GET_CODEC_FN(unsigned * count, unsigned ); \
00394 struct PluginCodec_Definition * Opal_StaticCodec_##name##_GetCodecs(unsigned * p1, unsigned p2) \
00395 { return PLUGIN_CODEC_GET_CODEC_FN(p1,p2); } \
00396
00397 #else
00398
00399 # define PLUGIN_CODEC_IMPLEMENT(name) \
00400 PLUGIN_CODEC_DLL_API unsigned int PLUGIN_CODEC_API_VER_FN() \
00401 { return PWLIB_PLUGIN_API_VERSION; } \
00402
00403 #endif
00404
00405 #ifdef __cplusplus
00406 };
00407 #endif
00408
00410
00411
00412 #ifdef _WIN32 // Only Support Win32 at the moment
00413
00414
00415 #define PLUGIN_HID_GET_DEVICE_FN OpalHIDPlugin_GetDevice
00416 #define PLUGIN_HID_GET_DEVICE_FN_STR "OpalHIDPlugin_GetDevice"
00417
00418 #define PLUGIN_HID_VERSION 1 // initial version
00419
00420 # define PLUGIN_HID_IMPLEMENT(name) \
00421 PLUGIN_CODEC_DLL_API unsigned int PLUGIN_CODEC_API_VER_FN() \
00422 { return PWLIB_PLUGIN_API_VERSION; } \
00423
00424
00425 struct PluginHID_information {
00426
00427 time_t timestamp;
00428
00429 const char * sourceAuthor;
00430 const char * sourceVersion;
00431 const char * sourceEmail;
00432 const char * sourceURL;
00433 const char * sourceCopyright;
00434 const char * sourceLicense;
00435 unsigned char sourceLicenseCode;
00436
00437 const char * HIDDescription;
00438 const char * HIDManufacturer;
00439 const char * HIDModel;
00440 const char * HIDEmail;
00441 const char * HIDURL;
00442
00443
00444
00445 };
00446
00447 enum PluginHID_Flags {
00448 PluginHID_TypeMask = 0x000f,
00449 PluginHID_TypeUSBAudio = 0x0000,
00450 PluginHID_TypePCIAudio = 0x0001,
00451
00452 PluginHID_ToneMask = 0x0010,
00453 PluginHID_NoTone = 0x0000,
00454 PluginHID_Tone = 0x0010,
00455
00456 PluginHID_GatewayMask = 0x0020,
00457 PluginHID_NoPSTN = 0x0000,
00458 PluginHID_PSTN = 0x0020,
00459
00460 PluginHID_DeviceTypeMask = 0x0040,
00461 PluginHID_DevicePOTS = 0x0000,
00462 PluginHID_DeviceCell = 0x0040,
00463
00464 PluginHID_DeviceSoundMask = 0x0080,
00465 PluginHID_DeviceInternal = 0x0000,
00466 PluginHID_DeviceSound = 0x0080
00467 };
00468
00469
00470 enum PluginHID_Input {
00471 PluginHID_None = 0x0000,
00472 PluginHID_KeyPadMask = 0x0010,
00473 PluginHID_Key0 = 0x0010,
00474 PluginHID_Key1 = 0x0011,
00475 PluginHID_Key2 = 0x0012,
00476 PluginHID_Key3 = 0x0013,
00477 PluginHID_Key4 = 0x0014,
00478 PluginHID_Key5 = 0x0015,
00479 PluginHID_Key6 = 0x0016,
00480 PluginHID_Key7 = 0x0017,
00481 PluginHID_Key8 = 0x0018,
00482 PluginHID_Key9 = 0x0019,
00483 PluginHID_KeyStar = 0x001a,
00484 PluginHID_KeyHash = 0x001b,
00485 PluginHID_KeyA = 0x001c,
00486 PluginHID_KeyB = 0x001d,
00487 PluginHID_KeyC = 0x001e,
00488 PluginHID_KeyD = 0x001f,
00489
00490 PluginHID_HookMask = 0x0020,
00491 PluginHID_OffHook = 0x0021,
00492 PluginHID_OnHook = 0x0022,
00493
00494 PluginHID_RingMask = 0x0030,
00495 PluginHID_StartRing = 0x0031,
00496 PluginHID_StopRing = 0x0032,
00497
00498 PluginHID_VolumeMask = 0x0040,
00499 PluginHID_VolumeUp = 0x0040,
00500 PluginHID_VolumeDown = 0x0041,
00501 PluginHID_SetRecVol = 0x0042,
00502 PluginHID_GetRecVol = 0x0043,
00503 PluginHID_SetPlayVol = 0x0044,
00504 PluginHID_GetPlayVol = 0x0045,
00505
00506 PluginHID_StateMask = 0x0050,
00507 PluginHID_PluggedIn = 0x0050,
00508 PluginHID_Unplugged = 0x0051,
00509
00510 PluginHID_FunctionMask = 0x0060,
00511 PluginHID_ClearDisplay = 0x0061,
00512
00513 };
00514
00515 struct PluginHID_Definition {
00516 unsigned int version;
00517
00518
00519 struct PluginHID_information * info;
00520
00521 unsigned int flags;
00522
00523 const char * descr;
00524 const char * sound;
00525
00526 void * (*createHID)(const struct PluginHID_Definition * def);
00527 void (*destroyHID) (const struct PluginHID_Definition * def);
00528 unsigned int (*HIDFunction) (const struct PluginHID_Definition * def,
00529 unsigned int * InputMask, unsigned int * newVal);
00530 void (*displayHID) (const struct PluginHID_Definition * def, const char * display);
00531
00532
00533
00534 };
00535
00536 typedef struct PluginHID_Definition * (* PluginHID_GetHIDFunction)(unsigned int *, unsigned int);
00537 typedef unsigned (* PluginHID_GetAPIVersionFunction)();
00538
00539 #endif // LID Plugins
00540
00541 #endif