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