# opalpluginmgr.h

Go to the documentation of this file.

    00001 /*
    00002  * opalpluginmgr.h
    00003  *
    00004  * OPAL codec plugins handler
    00005  *
    00006  * OPAL Library
    00007  *
    00008  * Copyright (C) 2005-2006 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 Phone Abstraction Library.
    00021  *
    00022  * The Initial Developer of the Original Code is Post Increment
    00023  *
    00024  * Contributor(s): ______________________________________.
    00025  *
    00026  * $Revision: 20627 $
    00027  * $Author: rjongbloed $
    00028  * $Date: 2008-07-28 01:58:31 +0000 (Mon, 28 Jul 2008) $
    00029  */
    00030
    00031 #ifndef __OPALPLUGINMGR_H
    00032 #define __OPALPLUGINMGR_H
    00033
    00034 #ifdef P_USE_PRAGMA
    00035 #pragma interface
    00036 #endif
    00037
    00038 #include <ptlib/object.h>
    00039
    00040 #include <opal/buildopts.h>
    00041
    00042 #include <ptlib/pluginmgr.h>
    00043 #include <ptlib/pfactory.h>
    00044 #include <codec/opalplugin.h>
    00045 #include <opal/mediafmt.h>
    00046 #include <opal/transcoders.h>
    00047
    00048 #if OPAL_H323
    00049 #include <h323/h323caps.h>
    00050 #endif
    00051
    00052 #if OPAL_VIDEO
    00053 #include <codec/vidcodec.h>
    00054 #endif
    00055
    00056
    00058
    00059 class H323Capability;
    00060
    00061 class H323StaticPluginCodec
    00062 {
    00063   public:
    00064     virtual ~H323StaticPluginCodec() { }
    00065     virtual PluginCodec_GetAPIVersionFunction Get_GetAPIFn() = 0;
    00066     virtual PluginCodec_GetCodecFunction Get_GetCodecFn() = 0;
    00067 };
    00068
    00069 typedef PFactory<H323StaticPluginCodec> H323StaticPluginCodecFactory;
    00070
    00071
    00073
    00074 class OpalPluginCodecManager;
    00075
    00076 class OpalPluginCodecHandler : public PObject
    00077 {
    00078   PCLASSINFO(OpalPluginCodecHandler, PObject);
    00079   public:
    00080     OpalPluginCodecHandler();
    00081
    00082     virtual OpalMediaFormatInternal * OnCreateAudioFormat(OpalPluginCodecManager & mgr,
    00083                                             const PluginCodec_Definition * encoderCodec,
    00084                                                               const char * rtpEncodingName,
    00085                                                                   unsigned frameTime,
    00086                                                                   unsigned timeUnits,
    00087                                                                     time_t timeStamp);
    00088
    00089 #if OPAL_VIDEO
    00090     virtual OpalMediaFormatInternal * OnCreateVideoFormat(OpalPluginCodecManager & mgr,
    00091                                             const PluginCodec_Definition * encoderCodec,
    00092                                                               const char * rtpEncodingName,
    00093                                                                     time_t timeStamp);
    00094     virtual void RegisterVideoTranscoder(const PString & src, const PString & dst, PluginCodec_Definition * codec, PBoolean v);
    00095 #endif
    00096
    00097 #if OPAL_T38_CAPABILITY
    00098     virtual OpalMediaFormatInternal * OnCreateFaxFormat(OpalPluginCodecManager & mgr,
    00099                                           const PluginCodec_Definition * encoderCodec,
    00100                                                             const char * rtpEncodingName,
    00101                                                                 unsigned frameTime,
    00102                                                                 unsigned timeUnits,
    00103                                                                   time_t timeStamp);
    00104 #endif
    00105 };
    00106
    00107
    00108 class OpalPluginCodecManager : public PPluginModuleManager
    00109 {
    00110   PCLASSINFO(OpalPluginCodecManager, PPluginModuleManager);
    00111   public:
    00112     OpalPluginCodecManager(PPluginManager * pluginMgr = NULL);
    00113     ~OpalPluginCodecManager();
    00114
    00115     void RegisterStaticCodec(const H323StaticPluginCodecFactory::Key_T & name,
    00116                              PluginCodec_GetAPIVersionFunction getApiVerFn,
    00117                              PluginCodec_GetCodecFunction getCodecFn);
    00118
    00119     void OnLoadPlugin(PDynaLink & dll, INT code);
    00120
    00121     virtual void OnShutdown();
    00122
    00123     static void Bootstrap();
    00124
    00125 #if OPAL_H323
    00126     H323Capability * CreateCapability(
    00127           const PString & _mediaFormat,
    00128           const PString & _baseName,
    00129                  unsigned maxFramesPerPacket,
    00130                  unsigned recommendedFramesPerPacket,
    00131                  unsigned _pluginSubType);
    00132 #endif
    00133
    00134   protected:
    00135     void RegisterPluginPair(
    00136       PluginCodec_Definition * _encoderCodec,
    00137       PluginCodec_Definition * _decoderCodec,
    00138       OpalPluginCodecHandler * handler
    00139     );
    00140
    00141     // Note the below MUST NOT be an OpalMediaFormatList
    00142     PList<OpalMediaFormat> mediaFormatsOnHeap;
    00143
    00144     void RegisterCodecPlugins  (unsigned int count, PluginCodec_Definition * codecList, OpalPluginCodecHandler * handler);
    00145     void UnregisterCodecPlugins(unsigned int count, PluginCodec_Definition * codecList, OpalPluginCodecHandler * handler);
    00146
    00147 #if OPAL_H323
    00148     void RegisterCapability(PluginCodec_Definition * encoderCodec, PluginCodec_Definition * decoderCodec);
    00149 #endif
    00150 };
    00151
    00152
    00154
    00155 class OpalPluginControl
    00156 {
    00157   public:
    00158     OpalPluginControl(const PluginCodec_Definition * def, const char * name);
    00159
    00160     PBoolean Exists() const
    00161     {
    00162       return controlDef != NULL;
    00163     }
    00164
    00165     int Call(void * parm, unsigned * parmLen, void * context = NULL) const
    00166     {
    00167       return controlDef != NULL ? (*controlDef->control)(codecDef, context, fnName, parm, parmLen) : -1;
    00168     }
    00169
    00170     int Call(void * parm, unsigned   parmLen, void * context = NULL) const
    00171     {
    00172       return Call(parm, &parmLen, context);
    00173     }
    00174
    00175     const char * GetName() const { return fnName; }
    00176
    00177   protected:
    00178     const PluginCodec_Definition  * codecDef;
    00179     const char                    * fnName;
    00180     const PluginCodec_ControlDefn * controlDef;
    00181 };
    00182
    00183
    00185
    00186 class OpalPluginMediaFormatInternal
    00187 {
    00188   public:
    00189     OpalPluginMediaFormatInternal(const PluginCodec_Definition * defn);
    00190
    00191     bool AdjustOptions(OpalMediaFormatInternal & fmt, OpalPluginControl & control) const;
    00192     void PopulateOptions(OpalMediaFormatInternal & format);
    00193     void SetOldStyleOption(OpalMediaFormatInternal & format, const PString & _key, const PString & _val, const PString & type);
    00194     bool IsValidForProtocol(const PString & _protocol) const;
    00195
    00196     const PluginCodec_Definition * codecDef;
    00197     OpalPluginControl getOptionsControl;
    00198     OpalPluginControl freeOptionsControl;
    00199     OpalPluginControl validForProtocolControl;
    00200     OpalPluginControl toNormalisedControl;
    00201     OpalPluginControl toCustomisedControl;
    00202 };
    00203
    00204
    00205 class OpalPluginMediaFormat : public OpalMediaFormat
    00206 {
    00207   public:
    00208     OpalPluginMediaFormat(OpalMediaFormatInternal * info)
    00209       : OpalMediaFormat(info)
    00210     {
    00211     }
    00212
    00213     OpalPluginMediaFormatInternal * GetInfo() const { return dynamic_cast<OpalPluginMediaFormatInternal *>(m_info); }
    00214 };
    00215
    00216
    00217 class OpalPluginTranscoder
    00218 {
    00219   public:
    00220     OpalPluginTranscoder(const PluginCodec_Definition * defn, PBoolean isEnc);
    00221     ~OpalPluginTranscoder();
    00222
    00223     bool UpdateOptions(const OpalMediaFormat & fmt);
    00224     PBoolean Transcode(const void * from, unsigned * fromLen, void * to, unsigned * toLen, unsigned * flags) const
    00225     {
    00226       return codecDef != NULL && codecDef->codecFunction != NULL &&
    00227             (codecDef->codecFunction)(codecDef, context, from, fromLen, to, toLen, flags) != 0;
    00228     }
    00229
    00230   protected:
    00231     const PluginCodec_Definition * codecDef;
    00232     PBoolean   isEncoder;
    00233     void * context;
    00234
    00235     OpalPluginControl setCodecOptions;
    00236     OpalPluginControl getOutputDataSizeControl;
    00237 };
    00238
    00239
    00241
    00242 class OpalPluginAudioFormatInternal : public OpalAudioFormatInternal, public OpalPluginMediaFormatInternal
    00243 {
    00244   public:
    00245     friend class OpalPluginCodecManager;
    00246
    00247     OpalPluginAudioFormatInternal(
    00248       const PluginCodec_Definition * _encoderCodec,
    00249       const char * rtpEncodingName,
    00250       unsigned frameTime,
    00251       unsigned /*timeUnits*/,
    00252       time_t timeStamp
    00253     );
    00254     virtual PObject * Clone() const;
    00255     virtual bool IsValidForProtocol(const PString & protocol) const;
    00256     virtual bool ToNormalisedOptions();
    00257     virtual bool ToCustomisedOptions();
    00258 };
    00259
    00260
    00261 class OpalPluginFramedAudioTranscoder : public OpalFramedTranscoder, public OpalPluginTranscoder
    00262 {
    00263   PCLASSINFO(OpalPluginFramedAudioTranscoder, OpalFramedTranscoder);
    00264   public:
    00265     OpalPluginFramedAudioTranscoder(PluginCodec_Definition * _codec, PBoolean _isEncoder, const char * rawFormat = NULL);
    00266     bool UpdateMediaFormats(const OpalMediaFormat & input, const OpalMediaFormat & output);
    00267     PBoolean ConvertFrame(const BYTE * input, PINDEX & consumed, BYTE * output, PINDEX & created);
    00268     virtual PBoolean ConvertSilentFrame(BYTE * buffer);
    00269     virtual bool AcceptComfortNoise() const { return comfortNoise; }
    00270   protected:
    00271     bool comfortNoise;
    00272 };
    00273
    00274
    00275 class OpalPluginStreamedAudioTranscoder : public OpalStreamedTranscoder, public OpalPluginTranscoder
    00276 {
    00277   PCLASSINFO(OpalPluginStreamedAudioTranscoder, OpalStreamedTranscoder);
    00278   public:
    00279     OpalPluginStreamedAudioTranscoder(PluginCodec_Definition * _codec, PBoolean _isEncoder, unsigned inputBits, unsigned outputBits);
    00280     bool UpdateMediaFormats(const OpalMediaFormat & input, const OpalMediaFormat & output);
    00281     virtual bool AcceptComfortNoise() const { return comfortNoise; }
    00282   protected:
    00283     bool comfortNoise;
    00284 };
    00285
    00286
    00287 class OpalPluginStreamedAudioEncoder : public OpalPluginStreamedAudioTranscoder
    00288 {
    00289   PCLASSINFO(OpalPluginStreamedAudioEncoder, OpalPluginStreamedAudioTranscoder);
    00290   public:
    00291     OpalPluginStreamedAudioEncoder(PluginCodec_Definition * _codec, PBoolean);
    00292     int ConvertOne(int _sample) const;
    00293 };
    00294
    00295 class OpalPluginStreamedAudioDecoder : public OpalPluginStreamedAudioTranscoder
    00296 {
    00297   PCLASSINFO(OpalPluginStreamedAudioDecoder, OpalPluginStreamedAudioTranscoder);
    00298   public:
    00299     OpalPluginStreamedAudioDecoder(PluginCodec_Definition * _codec, PBoolean);
    00300     int ConvertOne(int codedSample) const;
    00301 };
    00302
    00303
    00305
    00306 #if OPAL_VIDEO
    00307
    00308 class OpalPluginVideoFormatInternal : public OpalVideoFormatInternal, public OpalPluginMediaFormatInternal
    00309 {
    00310   public:
    00311     OpalPluginVideoFormatInternal(
    00312       const PluginCodec_Definition * _encoderCodec,
    00313       const char * rtpEncodingName,
    00314       time_t timeStamp
    00315     );
    00316     virtual PObject * Clone() const;
    00317     virtual bool IsValidForProtocol(const PString & protocol) const;
    00318     virtual bool ToNormalisedOptions();
    00319     virtual bool ToCustomisedOptions();
    00320 };
    00321
    00322
    00323 class OpalPluginVideoTranscoder : public OpalVideoTranscoder, public OpalPluginTranscoder
    00324 {
    00325   PCLASSINFO(OpalPluginVideoTranscoder, OpalVideoTranscoder);
    00326   public:
    00327     OpalPluginVideoTranscoder(const PluginCodec_Definition * _codec, PBoolean _isEncoder);
    00328     ~OpalPluginVideoTranscoder();
    00329
    00330     PBoolean ConvertFrames(const RTP_DataFrame & src, RTP_DataFrameList & dstList);
    00331     bool UpdateMediaFormats(const OpalMediaFormat & input, const OpalMediaFormat & output);
    00332
    00333   protected:
    00334     RTP_DataFrame * bufferRTP;
    00335
    00336 #if PTRACING
    00337     unsigned consecutiveIntraFrames;
    00338 #endif
    00339 };
    00340
    00341 #endif
    00342
    00344
    00345 #if OPAL_T38_CAPABILITY
    00346
    00347 class OpalPluginFaxFormatInternal : public OpalMediaFormatInternal, public OpalPluginMediaFormatInternal
    00348 {
    00349   public:
    00350     OpalPluginFaxFormatInternal(
    00351       const PluginCodec_Definition * _encoderCodec,
    00352       const char * rtpEncodingName,
    00353       unsigned frameTime,
    00354       unsigned /*timeUnits*/,
    00355       time_t timeStamp
    00356     );
    00357     virtual PObject * Clone() const;
    00358     virtual bool IsValidForProtocol(const PString & protocol) const;
    00359 };
    00360
    00361 #endif // OPAL_T38_CAPABILITY
    00362
    00363
    00365 //
    00366 //  this is the base class for codecs accesible via the abstract factory functions
    00367 //
    00368
    00376 class OpalFactoryCodec : public PObject {
    00377   PCLASSINFO(OpalFactoryCodec, PObject)
    00378   public:
    00380     virtual const struct PluginCodec_Definition * GetDefinition()
    00381     { return NULL; }
    00382
    00384     virtual PString GetInputFormat() const = 0;
    00385
    00387     virtual PString GetOutputFormat() const = 0;
    00388
    00390     virtual int Encode(const void * from,
    00391                          unsigned * fromLen,
    00392                              void * to,
    00393                                  unsigned * toLen,
    00394                      unsigned int * flag
    00395                        ) = 0;
    00396
    00398     virtual unsigned int GetSampleRate() const = 0;
    00399
    00401     virtual unsigned int GetBitsPerSec() const = 0;
    00402
    00404     virtual unsigned int GetFrameTime() const = 0;
    00405
    00407     virtual unsigned int GetSamplesPerFrame() const = 0;
    00408
    00410     virtual unsigned int GetBytesPerFrame() const = 0;
    00411
    00413     virtual unsigned int GetRecommendedFramesPerPacket() const = 0;
    00414
    00416     virtual unsigned int GetMaxFramesPerPacket() const = 0;
    00417
    00419     virtual BYTE         GetRTPPayload() const = 0;
    00420
    00422     virtual PString      GetSDPFormat() const = 0;
    00423 };
    00424
    00426
    00427 template<class TranscoderClass>
    00428 class OpalPluginTranscoderFactory : public OpalTranscoderFactory
    00429 {
    00430   public:
    00431     class Worker : public OpalTranscoderFactory::WorkerBase
    00432     {
    00433       public:
    00434         Worker(const OpalTranscoderKey & key, PluginCodec_Definition * _codecDefn, PBoolean _isEncoder)
    00435           : OpalTranscoderFactory::WorkerBase(), codecDefn(_codecDefn), isEncoder(_isEncoder)
    00436         { OpalTranscoderFactory::Register(key, this); }
    00437
    00438       protected:
    00439         virtual OpalTranscoder * Create(const OpalTranscoderKey &) const
    00440         { return new TranscoderClass(codecDefn, isEncoder); }
    00441
    00442         PluginCodec_Definition * codecDefn;
    00443         PBoolean isEncoder;
    00444     };
    00445 };
    00446
    00448 //
    00449 // Helper class for handling plugin capabilities
    00450 //
    00451
    00452 class H323PluginCapabilityInfo
    00453 {
    00454   public:
    00455     H323PluginCapabilityInfo(const PluginCodec_Definition * _encoderCodec,
    00456                              const PluginCodec_Definition * _decoderCodec);
    00457
    00458     H323PluginCapabilityInfo(const PString & _baseName);
    00459
    00460     const PString & GetFormatName() const
    00461     { return capabilityFormatName; }
    00462
    00463   protected:
    00464     const PluginCodec_Definition * encoderCodec;
    00465     const PluginCodec_Definition * decoderCodec;
    00466     PString                        capabilityFormatName;
    00467 };
    00468
    00469 #if OPAL_H323
    00470
    00472 //
    00473 // Class for handling most audio plugin capabilities
    00474 //
    00475
    00476 class H323AudioPluginCapability : public H323AudioCapability,
    00477                                   public H323PluginCapabilityInfo
    00478 {
    00479   PCLASSINFO(H323AudioPluginCapability, H323AudioCapability);
    00480   public:
    00481     H323AudioPluginCapability(const PluginCodec_Definition * _encoderCodec,
    00482                               const PluginCodec_Definition * _decoderCodec,
    00483                               unsigned _pluginSubType);
    00484
    00485     // this constructor is only used when creating a capability without a codec
    00486     H323AudioPluginCapability(const PString & _mediaFormat,
    00487                               const PString & _baseName,
    00488                               unsigned _pluginSubType);
    00489
    00490     virtual PObject * Clone() const;
    00491
    00492     virtual PString GetFormatName() const;
    00493
    00494     virtual unsigned GetSubType() const;
    00495
    00496   protected:
    00497     unsigned pluginSubType;
    00498     //unsigned h323subType;   // only set if using capability without codec
    00499 };
    00500
    00501 #define OPAL_DECLARE_EMPTY_AUDIO_CAPABILITY(fmt, type) \
    00502 class fmt##_CapabilityRegisterer { \
    00503   public: \
    00504     fmt##_CapabilityRegisterer() \
    00505     { H323CapabilityFactory::Register(fmt, new H323AudioPluginCapability(fmt, fmt, type)); } \
    00506 }; \
    00507
    00508 #define OPAL_DEFINE_EMPTY_AUDIO_CAPABILITY(fmt) \
    00509 static fmt##_CapabilityRegisterer fmt##_CapabilityRegisterer_instance; \
    00510
    00512 //
    00513 // Class for handling G.723.1 codecs
    00514 //
    00515
    00516 class H323PluginG7231Capability : public H323AudioPluginCapability
    00517 {
    00518   PCLASSINFO(H323PluginG7231Capability, H323AudioPluginCapability);
    00519   public:
    00520     H323PluginG7231Capability(const PluginCodec_Definition * _encoderCodec,
    00521                               const PluginCodec_Definition * _decoderCodec,
    00522                               PBoolean _annexA = PTrue);
    00523
    00524     // this constructor is used for creating empty codecs
    00525     H323PluginG7231Capability(const OpalMediaFormat & fmt, PBoolean _annexA = PTrue);
    00526
    00527     virtual PObject * Clone() const;
    00528     virtual PBoolean OnSendingPDU(H245_AudioCapability & cap, unsigned packetSize) const;
    00529     virtual PBoolean OnReceivedPDU(const H245_AudioCapability & cap,  unsigned & packetSize);
    00530
    00531   protected:
    00532     PBoolean annexA;
    00533 };
    00534
    00535 #define OPAL_DECLARE_EMPTY_G7231_CAPABILITY(fmt, annex) \
    00536 class fmt##_CapabilityRegisterer { \
    00537   public: \
    00538     fmt##_CapabilityRegisterer() \
    00539     { H323CapabilityFactory::Register(fmt, new H323PluginG7231Capability(fmt, annex)); } \
    00540 }; \
    00541
    00542 #define OPAL_DEFINE_EMPTY_G7231_CAPABILITY(fmt) \
    00543 static fmt##_CapabilityRegisterer fmt##_CapabilityRegisterer_instance; \
    00544
    00546 //
    00547 // Class for handling non standard audio capabilities
    00548 //
    00549
    00550 class H323CodecPluginNonStandardAudioCapability : public H323NonStandardAudioCapability,
    00551                                                   public H323PluginCapabilityInfo
    00552 {
    00553   PCLASSINFO(H323CodecPluginNonStandardAudioCapability, H323NonStandardAudioCapability);
    00554   public:
    00555     H323CodecPluginNonStandardAudioCapability(const PluginCodec_Definition * _encoderCodec,
    00556                                               const PluginCodec_Definition * _decoderCodec,
    00557                                               H323NonStandardCapabilityInfo::CompareFuncType compareFunc,
    00558                                               const unsigned char * data, unsigned dataLen);
    00559
    00560     H323CodecPluginNonStandardAudioCapability(const PluginCodec_Definition * _encoderCodec,
    00561                                               const PluginCodec_Definition * _decoderCodec,
    00562                                               const unsigned char * data, unsigned dataLen);
    00563
    00564     virtual PObject * Clone() const;
    00565
    00566     virtual PString GetFormatName() const;
    00567 };
    00568
    00570 //
    00571 // Class for handling generic audio capabilities
    00572 //
    00573
    00574 class H323CodecPluginGenericAudioCapability : public H323GenericAudioCapability,
    00575                                               public H323PluginCapabilityInfo
    00576 {
    00577   PCLASSINFO(H323CodecPluginGenericAudioCapability, H323GenericAudioCapability);
    00578   public:
    00579     H323CodecPluginGenericAudioCapability(const PluginCodec_Definition * _encoderCodec,
    00580                                           const PluginCodec_Definition * _decoderCodec,
    00581                                           const PluginCodec_H323GenericCodecData * data);
    00582
    00583     virtual PObject * Clone() const;
    00584     virtual PString GetFormatName() const;
    00585 };
    00586
    00587
    00588 #if OPAL_VIDEO
    00589
    00591 //
    00592 // Class for handling most audio plugin capabilities
    00593 //
    00594
    00595 class H323VideoPluginCapability : public H323VideoCapability,
    00596                              public H323PluginCapabilityInfo
    00597 {
    00598   PCLASSINFO(H323VideoPluginCapability, H323VideoCapability);
    00599   public:
    00600     H323VideoPluginCapability(const PluginCodec_Definition * _encoderCodec,
    00601                               const PluginCodec_Definition * _decoderCodec,
    00602                               unsigned _pluginSubType);
    00603
    00604     virtual PString GetFormatName() const;
    00605
    00606     virtual unsigned GetSubType() const;
    00607
    00608     static PBoolean SetOptionsFromMPI(OpalMediaFormat & mediaFormat, int frameWidth, int frameHeight, int frameRate);
    00609
    00610     virtual void PrintOn(std::ostream & strm) const;
    00611
    00612   protected:
    00613     unsigned pluginSubType;
    00614     unsigned h323subType;   // only set if using capability without codec
    00615 };
    00616
    00618 //
    00619 // Class for handling non standard video capabilities
    00620 //
    00621
    00622 class H323CodecPluginNonStandardVideoCapability : public H323NonStandardVideoCapability,
    00623                                                   public H323PluginCapabilityInfo
    00624 {
    00625   PCLASSINFO(H323CodecPluginNonStandardVideoCapability, H323NonStandardVideoCapability);
    00626   public:
    00627     H323CodecPluginNonStandardVideoCapability(const PluginCodec_Definition * _encoderCodec,
    00628                                               const PluginCodec_Definition * _decoderCodec,
    00629                                               H323NonStandardCapabilityInfo::CompareFuncType compareFunc,
    00630                                               const unsigned char * data, unsigned dataLen);
    00631
    00632     H323CodecPluginNonStandardVideoCapability(const PluginCodec_Definition * _encoderCodec,
    00633                                               const PluginCodec_Definition * _decoderCodec,
    00634                                               const unsigned char * data, unsigned dataLen);
    00635
    00636     virtual PObject * Clone() const;
    00637
    00638     virtual PString GetFormatName() const;
    00639 };
    00640
    00642 //
    00643 // Class for handling generic video capabilities
    00644 //
    00645
    00646 class H323CodecPluginGenericVideoCapability : public H323GenericVideoCapability,
    00647                                               public H323PluginCapabilityInfo
    00648 {
    00649   PCLASSINFO(H323CodecPluginGenericVideoCapability, H323GenericVideoCapability);
    00650   public:
    00651     H323CodecPluginGenericVideoCapability(const PluginCodec_Definition * _encoderCodec,
    00652                                           const PluginCodec_Definition * _decoderCodec,
    00653                                           const PluginCodec_H323GenericCodecData * data);
    00654
    00655     virtual PObject * Clone() const;
    00656
    00657     virtual PString GetFormatName() const;
    00658 };
    00659
    00661 //
    00662 // Class for handling H.261 plugin capabilities
    00663 //
    00664
    00665 class H323H261PluginCapability : public H323VideoPluginCapability
    00666 {
    00667   PCLASSINFO(H323H261PluginCapability, H323VideoPluginCapability);
    00668   public:
    00669     H323H261PluginCapability(const PluginCodec_Definition * _encoderCodec,
    00670                              const PluginCodec_Definition * _decoderCodec);
    00671
    00672     Comparison Compare(const PObject & obj) const;
    00673
    00674     virtual PObject * Clone() const;
    00675
    00676     virtual PBoolean OnSendingPDU(
    00677       H245_VideoCapability & pdu
    00678     ) const;
    00679
    00680     virtual PBoolean OnSendingPDU(
    00681       H245_VideoMode & pdu
    00682     ) const;
    00683
    00684     virtual PBoolean OnReceivedPDU(
    00685       const H245_VideoCapability & pdu
    00686     );
    00687 };
    00688
    00690 //
    00691 // Class for handling H.263 plugin capabilities
    00692 //
    00693
    00694 class H323H263PluginCapability : public H323VideoPluginCapability
    00695 {
    00696   PCLASSINFO(H323H263PluginCapability, H323VideoPluginCapability);
    00697   public:
    00698     H323H263PluginCapability(const PluginCodec_Definition * _encoderCodec,
    00699                              const PluginCodec_Definition * _decoderCodec);
    00700
    00701     Comparison Compare(const PObject & obj) const;
    00702
    00703     virtual PObject * Clone() const;
    00704
    00705     virtual PBoolean OnSendingPDU(
    00706       H245_VideoCapability & pdu
    00707     ) const;
    00708
    00709     virtual PBoolean OnSendingPDU(
    00710       H245_VideoMode & pdu
    00711     ) const;
    00712
    00713     virtual PBoolean OnReceivedPDU(
    00714       const H245_VideoCapability & pdu
    00715     );
    00716     virtual PBoolean IsMatch(const PASN_Choice & subTypePDU) const;
    00717 };
    00718
    00719 #endif // OPAL_VIDEO
    00720 #endif // OPAL_H323
    00721
    00722 #endif // __OPALPLUGINMGR_H