Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

opalplugin.h

Go to the documentation of this file.
00001 /* 00002 * h323plugins.h 00003 * 00004 * H.323 codec plugins handler 00005 * 00006 * Open H323 Library 00007 * 00008 * Copyright (C) 2004 Post Increment 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Open H323 Library. 00021 * 00022 * The Initial Developer of the Original Code is Post Increment 00023 * 00024 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: opalplugin.h,v $ 00027 * Revision 1.3 2004/05/18 22:26:28 csoutheren 00028 * Initial support for embedded codecs 00029 * Fixed problems with streamed codec support 00030 * Updates for abstract factory loading methods 00031 * 00032 * Revision 1.2 2004/05/09 14:44:36 csoutheren 00033 * Added support for streamed plugin audio codecs 00034 * 00035 * Revision 1.1 2004/04/09 12:25:25 csoutheren 00036 * Renamed from h323plugin.h 00037 * 00038 * Revision 1.2 2004/04/03 10:38:24 csoutheren 00039 * Added in initial cut at codec plugin code. Branches are for wimps :) 00040 * 00041 * Revision 1.1.2.1 2004/03/31 11:03:16 csoutheren 00042 * Initial public version 00043 * 00044 * Revision 1.8 2004/02/23 13:17:32 craigs 00045 * Fixed problems with codec interface functions 00046 * 00047 * Revision 1.7 2004/02/23 13:04:09 craigs 00048 * Removed warnings when compliing plugins 00049 * 00050 * Revision 1.6 2004/01/27 14:55:46 craigs 00051 * Implemented static linking of new codecs 00052 * 00053 * Revision 1.5 2004/01/23 05:21:15 craigs 00054 * Updated for changes to the codec plugin interface 00055 * 00056 * Revision 1.4 2004/01/09 11:27:46 craigs 00057 * Plugin codec audio now works :) 00058 * 00059 * Revision 1.3 2004/01/09 07:32:22 craigs 00060 * More fixes for capability problems 00061 * 00062 * Revision 1.2 2004/01/06 07:05:03 craigs 00063 * Changed to support plugin codecs 00064 * 00065 * Revision 1.1 2004/01/04 13:37:51 craigs 00066 * Implementation of codec plugins 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 // any license codes above here require royalty payments 00117 PluginCodec_License_RoyaltiesRequired = 0x80 00118 }; 00119 00120 struct PluginCodec_information { 00121 // start of version 1 fields 00122 time_t timestamp; // codec creation time and date - obtain with command: date -u "+%c = %s" 00123 00124 const char * sourceAuthor; // source code author 00125 const char * sourceVersion; // source code version 00126 const char * sourceEmail; // source code email contact information 00127 const char * sourceURL; // source code web site 00128 const char * sourceCopyright; // source code copyright 00129 const char * sourceLicense; // source code license 00130 unsigned char sourceLicenseCode; // source code license 00131 00132 const char * codecDescription; // codec description 00133 const char * codecAuthor; // codec author 00134 const char * codecVersion; // codec version 00135 const char * codecEmail; // codec email contact information 00136 const char * codecURL; // codec web site 00137 const char * codecCopyright; // codec copyright information 00138 const char * codecLicense; // codec license 00139 unsigned short codecLicenseCode; // codec license code 00140 // end of version 1 fields 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; // codec structure version 00177 00178 // start of version 1 fields 00179 struct PluginCodec_information * info; // license information 00180 00181 unsigned int flags; // b0-3: 0 = audio, 1 = video 00182 // b4: 0 = raw input, 1 = RTP input 00183 // b5: 0 = raw output, 1 = RTP output 00184 // b6: 0 = dynamic RTP, 1 = explicit RTP 00185 00186 const char * descr; // text decription 00187 00188 const char * sourceFormat; // source format 00189 const char * destFormat; // destination format 00190 00191 const void * userData; // user data value 00192 00193 unsigned int sampleRate; // samples per second 00194 unsigned int bitsPerSec; // raw bits per second 00195 unsigned int nsPerFrame; // nanoseconds per frame 00196 unsigned int samplesPerFrame; // samples per frame 00197 unsigned int bytesPerFrame; // max bytes per frame 00198 unsigned int recommendedFramesPerPacket; // recommended number of frames per packet 00199 unsigned int maxFramesPerPacket; // maximum number of frames per packet 00200 00201 unsigned char rtpPayload; // IANA RTP payload code (if defined) 00202 const char * sdpFormat; // SDP format string (or NULL, if no SDP format) 00203 00204 void * (*createCodec)(const struct PluginCodec_Definition * codec); // create codec 00205 void (*destroyCodec) (const struct PluginCodec_Definition * codec, void * context); // destroy codec 00206 int (*codecFunction) (const struct PluginCodec_Definition * codec, void * context, // do codec function 00207 const void * from, unsigned * fromLen, 00208 void * to, unsigned * toLen, 00209 unsigned int * flag); 00210 struct PluginCodec_ControlDefn * codecControls; 00211 00212 // H323 specific fields 00213 unsigned char h323CapabilityType; 00214 void * h323CapabilityData; 00215 00216 // end of version 1 fields 00217 }; 00218 00219 typedef struct PluginCodec_Definition * (* PluginCodec_GetCodecFunction)(unsigned int *, unsigned int); 00220 typedef unsigned (* PluginCodec_GetAPIVersionFunction)(); 00221 00223 // 00224 // H.323 specific values 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; // INTEGER (27..78), -- units octets 00253 int highRateMode1:6; // INTEGER (27..78), -- units octets 00254 int lowRateMode0:6; // INTEGER (23..66), -- units octets 00255 int lowRateMode1:6; // INTEGER (23..66), -- units octets 00256 int sidMode0:4; // INTEGER (6..17), -- units octets 00257 int sidMode1:4; // INTEGER (6..17), -- units octets 00258 }; 00259 00260 struct PluginCodec_H323VideoH261 00261 { 00262 int qcifMPI:2; // INTEGER (1..4) OPTIONAL, -- units 1/29.97 Hz 00263 int cifMPI:2; // INTEGER (1..4) OPTIONAL, -- units 1/29.97 Hz 00264 int temporalSpatialTradeOffCapability; // BOOLEAN, 00265 int maxBitRate; // INTEGER (1..19200), -- units of 100 bit/s 00266 int stillImageTransmission:1; // BOOLEAN, -- Annex D of H.261 00267 int videoBadMBsCap:1; // BOOLEAN 00268 const struct PluginCodec_H323CapabilityExtension * extensions; 00269 }; 00270 00271 enum { 00272 PluginCodec_H323Codec_undefined, // must be zero, so empty struct is undefined 00273 PluginCodec_H323Codec_programmed, // H323ProgrammedCapability 00274 PluginCodec_H323Codec_nonStandard, // H323NonStandardData 00275 PluginCodec_H323Codec_generic, // not yet implemented 00276 00277 // audio codecs 00278 PluginCodec_H323AudioCodec_g711Alaw_64k, // int 00279 PluginCodec_H323AudioCodec_g711Alaw_56k, // int 00280 PluginCodec_H323AudioCodec_g711Ulaw_64k, // int 00281 PluginCodec_H323AudioCodec_g711Ulaw_56k, // int 00282 PluginCodec_H323AudioCodec_g722_64k, // int 00283 PluginCodec_H323AudioCodec_g722_56k, // int 00284 PluginCodec_H323AudioCodec_g722_48k, // int 00285 PluginCodec_H323AudioCodec_g7231, // H323AudioG7231Data 00286 PluginCodec_H323AudioCodec_g728, // int 00287 PluginCodec_H323AudioCodec_g729, // int 00288 PluginCodec_H323AudioCodec_g729AnnexA, // int 00289 PluginCodec_H323AudioCodec_is11172, // not yet implemented 00290 PluginCodec_H323AudioCodec_is13818Audio, // not yet implemented 00291 PluginCodec_H323AudioCodec_g729wAnnexB, // int 00292 PluginCodec_H323AudioCodec_g729AnnexAwAnnexB, // int 00293 PluginCodec_H323AudioCodec_g7231AnnexC, // H323AudioG7231AnnexC 00294 PluginCodec_H323AudioCodec_gsmFullRate, // H323AudioGSMData 00295 PluginCodec_H323AudioCodec_gsmHalfRate, // H323AudioGSMData 00296 PluginCodec_H323AudioCodec_gsmEnhancedFullRate, // H323AudioGSMData 00297 PluginCodec_H323AudioCodec_g729Extensions, // not yet implemented 00298 00299 // video codecs 00300 PluginCodec_H323VideoCodec_h261, // not yet implemented 00301 PluginCodec_H323VideoCodec_h262, // not yet implemented 00302 PluginCodec_H323VideoCodec_h263, // not yet implemented 00303 PluginCodec_H323VideoCodec_is11172, // not yet implemented 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 /*version*/); \ 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 doxygen 1.3.7