⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 h323caps.h

📁 mgcp协议源代码。支持多种编码:g711
💻 H
📖 第 1 页 / 共 4 页
字号:
/* * h323caps.h * * H.323 protocol handler * * Open H323 Library * * Copyright (c) 1998-2000 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Open H323 Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Portions of this code were written with the assisance of funding from * Vovida Networks, Inc. http://www.vovida.com. * * Contributor(s): ______________________________________. * * $Log: h323caps.h,v $ * Revision 1.11  2000/07/13 12:25:47  robertj * Fixed problems with fast start frames per packet adjustment. * * Revision 1.10  2000/07/10 16:01:50  robertj * Started fixing capability set merging, still more to do. * * Revision 1.9  2000/07/04 01:16:49  robertj * Added check for capability allowed in "combinations" set, still needs more done yet. * * Revision 1.8  2000/06/03 03:16:47  robertj * Fixed using the wrong capability table (should be connections) for some operations. * * Revision 1.7  2000/05/23 11:32:27  robertj * Rewrite of capability table to combine 2 structures into one and move functionality into that class *    allowing some normalisation of usage across several applications. * Changed H323Connection so gets a copy of capabilities instead of using endponts, allows adjustments *    to be done depending on the remote client application. * * Revision 1.6  2000/05/18 11:53:34  robertj * Changes to support doc++ documentation generation. * * Revision 1.5  2000/05/10 04:05:26  robertj * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn. * * Revision 1.4  2000/05/02 04:32:24  robertj * Fixed copyright notice comment. * * Revision 1.3  2000/04/05 19:01:12  robertj * Added function so can change desired transmit packet size. * * Revision 1.2  2000/03/21 03:06:47  robertj * Changes to make RTP TX of exact numbers of frames in some codecs. * * Revision 1.1  1999/12/23 23:02:35  robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * */#ifndef __H323CAPS_H#define __H323CAPS_H#include "codecs.h"#include "channels.h"/* The following classes have forward references to avoid including the VERY   large header files for H225 and H245. If an application requires access   to the protocol classes they can include them, but for simple usage their   inclusion can be avoided. */class PASN_Choice;class H245_DataType;class H245_Capability;class H245_AudioCapability;class H245_VideoCapability;class H245_DataApplicationCapability;class H245_H2250LogicalChannelParameters;class H245_TerminalCapabilitySet;class H323Connection;////////////////////////////////////////////////////////////////////////////////**This class describes the interface to a capability of the endpoint, usually   a codec, used to transfer data via the logical channels opened and managed   by the H323 control channel.   Note that this is not an instance of the codec itself. Merely the   description of that codec. There is typically only one instance of this   class contained in the capability tables of the endpoint. There may be   several instances of the actualy codec managing the conversion of an   individual stream of data.   An application may create a descendent off this class and override   functions as required for describing a codec that it implements. */class H323Capability : public PObject{  PCLASSINFO(H323Capability, PObject);  public:  /**@name Construction */  //@{    /**Create a new capability specification.     */    H323Capability();  //@}  /**@name Overrides from class PObject */  //@{    /**Compare two capability instances. This compares the main and sub-types       of the capability.     */    Comparison Compare(const PObject & obj) const;    /**Print out the object to the stream, virtual version of << operator.     */    void PrintOn(ostream & strm) const;  //@}  /**@name Identification functions */  //@{    enum MainTypes {      /// Audio codec capability      e_Audio,      /// Video codec capability      e_Video,      /// Arbitrary data capability      e_Data,      /// User Input capability      e_UserInput,      /// Count of main types      e_NumMainTypes    };    /**Get the main type of the capability.       This function is overridden by one of the three main sub-classes off       which real capabilities would be descendend.     */    virtual MainTypes GetMainType() const = 0;    /**Get the sub-type of the capability. This is a code dependent on the       main type of the capability.     */    virtual unsigned  GetSubType()  const = 0;    /**Get the name of the media data format this class represents.     */    virtual PString GetFormatName() const = 0;  //@}  /**@name Operations */  //@{    /**Get the default RTP session.       This function gets the default RTP session ID for the capability       type. For example audio capabilities return the value       RTP_Session::DefaultAudioSessionID etc.       The default behaviour returns zero, indicating it is not an RTP       based capability.      */    virtual unsigned GetDefaultSessionID() const;    /**Set the maximum size (in frames) of data that will be transmitted in a       single PDU.       This will also be the desired number that will be sent by most codec       implemetations.       The default behaviour does nothing.     */    virtual void SetTxFramesInPacket(      unsigned frames   /// Number of frames per packet    );    /**Get the maximum size (in frames) of data that will be transmitted in a single PDU.       The default behaviour returns the value 1.     */    virtual unsigned GetTxFramesInPacket() const;    /**Get the maximum size (in frames) of data that can be received in a single PDU.       The default behaviour returns the value 1.     */    virtual unsigned GetRxFramesInPacket() const;    /**Get the maximum size (in bytes) of a single frame of codec data.       The default behaviour returns the value 1.     */    virtual unsigned GetMaxFrameSize() const;    /**Create the channel instance, allocating resources as required.       This creates a logical channel object appropriate for the parameters       provided. Not if param is NULL, sessionID must be provided, otherwise       this is taken from the fields in param.     */    virtual H323Channel * CreateChannel(      H323Connection & connection,    /// Owner connection for channel      H323Channel::Directions dir,    /// Direction of channel      unsigned sessionID,             /// Session ID for RTP channel      const H245_H2250LogicalChannelParameters * param                                      /// Parameters for channel    ) const = 0;    /**Create the codec instance, allocating resources as required.     */    virtual H323Codec * CreateCodec(      H323Codec::Direction direction  /// Direction in which this instance runs    ) const = 0;  //@}  /**@name Protocol manipulation */  //@{    /**This function is called whenever and outgoing TerminalCapabilitySet       PDU is being constructed for the control channel. It allows the       capability to set the PDU fields from information in members specific       to the class.       The default behaviour is pure.     */    virtual BOOL OnSendingPDU(      H245_Capability & pdu  /// PDU to set information on    ) const = 0;    /**This function is called whenever and outgoing OpenLogicalChannel       PDU is being constructed for the control channel. It allows the       capability to set the PDU fields from information in members specific       to the class.       The default behaviour is pure.     */    virtual BOOL OnSendingPDU(      H245_DataType & pdu  /// PDU to set information on    ) const = 0;    /**This function is called whenever and incoming TerminalCapabilitySet       PDU is received on the control channel, and a new H323Capability       descendent was created. This completes reading fields from the PDU       into the classes members.       If the function returns FALSE then the received PDU codec description       is not supported, so will be ignored. The default behaviour simply       returns TRUE.     */    virtual BOOL OnReceivedPDU(      const H245_Capability & pdu /// PDU to get information from    ) = 0;    /**This function is called whenever and incoming OpenLogicalChannel       PDU has been used to construct the control channel. It allows the       capability to set from the PDU fields, information in members specific       to the class.       The default behaviour is pure.     */    virtual BOOL OnReceivedPDU(      const H245_DataType & pdu,  /// PDU to get information from      BOOL receiver               /// Is receiver OLC    ) = 0;  //@}  /**@name Member variable access */  //@{    /// Get unique capability number.    unsigned GetCapabilityNumber() const { return assignedCapabilityNumber; }    /// Set unique capability number.    void SetCapabilityNumber(unsigned num) { assignedCapabilityNumber = num; }  //@}#if PTRACING    static const char * const MainTypesNames[e_NumMainTypes];    friend ostream & operator<<(ostream & o , MainTypes t) { return o << MainTypesNames[t]; }#endif  protected:    unsigned assignedCapabilityNumber;  /// Unique ID assigned to capability};/**This class describes the interface to a non-standard codec used to   transfer data via the logical channels opened and managed by the H323   control channel.   It is expected that an application makes a descendent off   H323NonStandardAudioCapability or H323NonStandardVideoCapability which   multiply inherit from this class. */class H323NonStandardCapabilityInfo{  public:    /**Create a new set of information about a non-standard codec.      */    H323NonStandardCapabilityInfo(      H323EndPoint & endpoint,        /// Endpoint to get t35 information      const BYTE * fixedData,      PINDEX dataSize    );    /**Create a new set of information about a non-standard codec.      */    H323NonStandardCapabilityInfo(      const PString & oid,      const BYTE * fixedData,      PINDEX dataSize    );    /**Create a new set of information about a non-standard codec.      */    H323NonStandardCapabilityInfo(      BYTE country,                  /// t35 information      BYTE extension,                /// t35 information      WORD maufacturer,              /// t35 information      const BYTE * fixedData,      PINDEX dataSize    );    /**Destroy the capability information     */    virtual ~H323NonStandardCapabilityInfo();    /**This function gets the non-standard data field.       The default behaviour sets data to fixedData.      */    virtual BOOL OnSendingPDU(      PBYTEArray & data  /// Data field in PDU to send    ) const;    /**This function validates and uses the non-standard data field.       The default behaviour returns TRUE if data is equal to fixedData.      */    virtual BOOL OnReceivedPDU(      const PBYTEArray & data  /// Data field in PDU received    );  protected:    BOOL OnSendingNonStandardPDU(      PASN_Choice & pdu,      unsigned nonStandardTag    ) const;    BOOL OnReceivedNonStandardPDU(      const PASN_Choice & pdu,      unsigned nonStandardTag    );    PString    oid;    BYTE       t35CountryCode;    BYTE       t35Extension;    WORD       manufacturerCode;    PBYTEArray fixedData;};/**This class describes the interface to a codec that has channels based on   the RTP protocol.   An application may create a descendent off this class and override   functions as required for descibing the codec. */class H323RealTimeCapability : public H323Capability{  PCLASSINFO(H323RealTimeCapability, H323Capability);  public:  /**@name Operations */  //@{    /**Create the channel instance, allocating resources as required.     */    virtual H323Channel * CreateChannel(      H323Connection & connection,    /// Owner connection for channel      H323Channel::Directions dir,    /// Direction of channel      unsigned sessionID,             /// Session ID for RTP channel      const H245_H2250LogicalChannelParameters * param                                      /// Parameters for channel    ) const;  //@}};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -