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

📄 channels.h

📁 mgcp协议源代码。支持多种编码:g711
💻 H
📖 第 1 页 / 共 2 页
字号:
/* * channels.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: channels.h,v $ * Revision 1.15  2000/06/15 01:46:13  robertj * Added channel pause (aka mute) functions. * * Revision 1.14  2000/05/18 11:53:33  robertj * Changes to support doc++ documentation generation. * * Revision 1.13  2000/05/02 04:32:23  robertj * Fixed copyright notice comment. * * Revision 1.12  1999/12/23 23:02:34  robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * * Revision 1.11  1999/11/19 09:06:30  robertj * Changed to close down logical channel if get a transmit codec error. * * Revision 1.10  1999/11/06 05:37:44  robertj * Complete rewrite of termination of connection to avoid numerous race conditions. * * Revision 1.9  1999/09/08 04:05:48  robertj * Added support for video capabilities & codec, still needs the actual codec itself! * * Revision 1.8  1999/08/31 12:34:18  robertj * Added gatekeeper support. * * Revision 1.7  1999/07/09 06:09:49  robertj * Major implementation. An ENORMOUS amount of stuff added everywhere. * * Revision 1.6  1999/06/14 05:15:55  robertj * Changes for using RTP sessions correctly in H323 Logical Channel context * * Revision 1.5  1999/06/13 12:41:14  robertj * Implement logical channel transmitter. * Fixed H245 connect on receiving call. * * Revision 1.4  1999/06/09 05:26:19  robertj * Major restructuring of classes. * * Revision 1.3  1999/06/06 06:06:36  robertj * Changes for new ASN compiler and v2 protocol ASN files. * * Revision 1.2  1999/04/26 06:14:46  craigs * Initial implementation for RTP decoding and lots of stuff * As a whole, these changes are called "First Noise" * * Revision 1.1  1999/01/16 01:31:07  robertj * Initial revision * */#ifndef __CHANNELS_H#define __CHANNELS_Hclass H245_OpenLogicalChannel;class H245_OpenLogicalChannelAck;class H245_OpenLogicalChannel_forwardLogicalChannelParameters;class H245_OpenLogicalChannel_reverseLogicalChannelParameters;class H245_MiscellaneousCommand_type;class H245_MiscellaneousIndication_type;class H323EndPoint;class H323Connection;class H323Capability;class H323Codec;class H323_RTP_Session;class RTP_Session;/**Description of a Logical Channel Number.   This is used as index into dictionary of logical channels. */class H323ChannelNumber : public PObject{  PCLASSINFO(H323ChannelNumber, PObject);  public:    H323ChannelNumber() { number = 0; fromRemote = FALSE; }    H323ChannelNumber(unsigned number, BOOL fromRemote);    virtual PObject * Clone() const;    virtual PINDEX HashFunction() const;    virtual void PrintOn(ostream & strm) const;    H323ChannelNumber & operator++(int);    operator unsigned() const { return number; }    BOOL IsFromRemote() const { return fromRemote; }      protected:    unsigned number;    BOOL     fromRemote;};/**This class describes a logical channel between the two endpoints. They may   be created and deleted as required in the H245 protocol.   An application may create a descendent off this class and override   functions as required for operating the channel protocol. */class H323Channel : public PObject{  PCLASSINFO(H323Channel, PObject);  public:  /**@name Construction */  //@{    /**Create a new channel.     */    H323Channel(      H323Connection & connection,        /// Connection to endpoint for channel      const H323Capability & capability   /// Capability channel is using    );    /**Destroy new channel.       To avoid usage of deleted objects in background threads, this waits       for the H323LogicalChannelThread to terminate before continuing.     */    ~H323Channel();  //@}  /**@name Operations */  //@{    enum Directions {      IsBidirectional,      IsTransmitter,      IsReceiver    };    /**Indicate the direction of the channel.       Return if the channel is bidirectional, or unidirectional, and which       direction for the latter case.     */    virtual Directions GetDirection() const = 0;    /**Indicate the session number of the channel.       Return session for channel. This is primarily for use by RTP based       channels, for channels for which the concept of a session is not       meaningfull, the default simply returns 0.     */    virtual unsigned GetSessionID() const;    /**Set the initial bandwidth for the channel.       This calculates the initial bandwidth required by the channel and       returns TRUE if the connection can support this bandwidth.       The default behaviour gets the bandwidth requirement from the codec       object created by the channel.     */    virtual BOOL SetInitialBandwidth();    /**This is called when the channel can start transferring data.     */    virtual void Start() = 0;    /**This is called to clean up any threads on connection termination.     */    virtual void CleanUpOnTermination();    /**Indicate if background thread(s) are running.     */    BOOL IsRunning() const;    /**Handle channel data reception.       This is called by the thread started by the Start() function and is       typically a loop writing to the codec and reading from the transport       (eg RTP_session).      */    virtual void Receive() = 0;    /**Handle channel data transmission.       This is called by the thread started by the Start() function and is       typically a loop reading from the codec and writing to the transport       (eg an RTP_session).      */    virtual void Transmit() = 0;    /**Fill out the OpenLogicalChannel PDU for the particular channel type.     */    virtual BOOL OnSendingPDU(      H245_OpenLogicalChannel & openPDU  /// Open PDU to send.     ) const = 0;    /**This is called when request to create a channel is received from a       remote machine and is about to be acknowledged.       The default behaviour does nothing.     */    virtual void OnSendOpenAck(      const H245_OpenLogicalChannel & open,   /// Open PDU      H245_OpenLogicalChannelAck & ack        /// Acknowledgement PDU    ) const;    /**This is called after a request to create a channel occurs from the       local machine via the H245LogicalChannelDict::Open() function, and       the request has been acknowledged by the remote endpoint.       The default behaviour just returns TRUE.     */    virtual BOOL OnReceivedPDU(      const H245_OpenLogicalChannel & pdu,    /// Open PDU      unsigned & errorCode                    /// Error code on failure    );    /**This is called after a request to create a channel occurs from the       local machine via the H245LogicalChannelDict::Open() function, and       the request has been acknowledged by the remote endpoint.       The default behaviour just returns TRUE.     */    virtual BOOL OnReceivedAckPDU(      const H245_OpenLogicalChannelAck & pdu  /// Acknowledgement PDU    );    /**Limit bit flow for the logical channel.       The default behaviour passes this on to the codec if not NULL.     */    virtual void OnFlowControl(      long bitRateRestriction   /// Bit rate limitation    );    /**Process a miscellaneous command on the logical channel.       The default behaviour passes this on to the codec if not NULL.     */    virtual void OnMiscellaneousCommand(      const H245_MiscellaneousCommand_type & type  /// Command to process    );    /**Process a miscellaneous indication on the logical channel.       The default behaviour passes this on to the codec if not NULL.     */    virtual void OnMiscellaneousIndication(

⌨️ 快捷键说明

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