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

📄 acmcodec.h

📁 radius协议源码÷The Radius Stack will connect to a Radius Server. This stack implementation is built upo
💻 H
字号:
/* * acmcodec.h * * Microsoft Audio Compression Manager codec interface * * 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. * * Contributor(s): ______________________________________. * * $Log: acmcodec.h,v $ * Revision 1.9  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.8  2000/05/02 04:32:23  robertj * Fixed copyright notice comment. * * Revision 1.7  1999/12/31 00:05:36  robertj * Added Microsoft ACM G.723.1 codec capability. * * Revision 1.6  1999/12/23 23:02:34  robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * * Revision 1.5  1999/11/19 08:08:27  robertj * Removed MS G.723.1 codec as cannot be used by other applications. * * Revision 1.4  1999/10/08 09:59:00  robertj * Rewrite of capability for sending multiple audio frames * * Revision 1.3  1999/10/08 04:58:37  robertj * Added capability for sending multiple audio frames in single RTP packet * * Revision 1.2  1999/09/23 07:06:44  robertj * More attempts at accessing G.723.1 codec via ACM * * Revision 1.1  1999/09/21 14:24:02  robertj * Added Windows ACM support. * */#ifndef __ACM_CODEC_H#define __ACM_CODEC_H#include <mmreg.h>#include <msacm.h>#include "h323caps.h"/**This class describes the Microsoft Audio Compression Manager codec capability. */class H323_ACMCapability : public H323NonStandardAudioCapability{  PCLASSINFO(H323_ACMCapability, H323NonStandardAudioCapability)  public:  /**@name Construction */  //@{    /**Create a new ACM capability.     */    H323_ACMCapability(      H323EndPoint & endpoint,      unsigned formatTag    );  //@}  /**@name Overrides from class PObject */  //@{    /**Create a copy of the object.      */    virtual PObject * Clone() const;  //@}  /**@name Identification functions */  //@{    /**Get the name of the media data format this class represents.     */    virtual PString GetFormatName() const;  //@}  /**@name Operations */  //@{    /**Create the codec instance, allocating resources as required.       As a data channel has no codec, this always returns NULL.     */    virtual H323Codec * CreateCodec(      H323Codec::Direction direction  /// Direction in which this instance runs    ) const;    /**Determine if the codec format tag specified for the object is valid.      */    BOOL IsValid() const;    /**Get a list of all valid codec format tag codes.      */    static PStringArray GetCodecNames();  //@}  protected:    unsigned formatTag;    PString  formatName;    RTP_DataFrame::PayloadTypes rtpPayloadType;};/**This class describes the ACM based G.723.1 codec capability. */class H323_ACMG7231Capability : public H323AudioCapability{  PCLASSINFO(H323_ACMG7231Capability, H323AudioCapability);  public:  /**@name Construction */  //@{    /**Create a new capability.     */    H323_ACMG7231Capability();  //@}  /**@name Overrides from class PObject */  //@{    /**Create a copy of the object.      */    virtual PObject * Clone() const;  //@}  /**@name Identification functions */  //@{    /**Get the sub-type of the capability. This is a code dependent on the       main type of the capability.       This returns H245_AudioCapability::e_nonStandard.     */    virtual unsigned GetSubType() const;    /**Get the name of the media data format this class represents.     */    virtual PString GetFormatName() const;  //@}  /**@name Operations */  //@{    /**Create the codec instance, allocating resources as required.     */    virtual H323Codec * CreateCodec(      H323Codec::Direction direction  /// Direction in which this instance runs    ) const;  //@}  /**@name Protocol manipulation */  //@{    /**This function is called whenever and outgoing TerminalCapabilitySet       or 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 sets the data rate field in the PDU.     */    virtual BOOL OnSendingPDU(      H245_AudioCapability & pdu,  /// PDU to set information on      unsigned packetSize          /// Packet size to use in capability    ) const;    /**This function is called whenever and incoming TerminalCapabilitySet       or 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 gets the data rate field from the PDU.     */    virtual BOOL OnReceivedPDU(      const H245_AudioCapability & pdu,  /// PDU to get information from      unsigned & packetSize              /// Packet size to use in capability    );  //@}    /**Determine if the codec format tag specified for the object is valid.      */    BOOL IsValid() const;};/**This class is a ACM codec. */class H323_ACMCodec : public H323FramedAudioCodec{  PCLASSINFO(H323_ACMCodec, H323FramedAudioCodec)  public:    /**Create a new ACM codec.     */    H323_ACMCodec(      Direction direction,           /// Direction in which this instance runs      const PWaveFormat & format,          /// Windows ACM format number      RTP_DataFrame::PayloadTypes rtpPayloadType /// RTP payload type.    );    ~H323_ACMCodec();    /**Open the codec.       This will open the codec for encoding or decoding, it is called after       the logical channel have been established and the background threads to       drive them have been started. This is primarily used to delay allocation       of resources until the last millisecond.      */    virtual BOOL Open(      H323Connection & connection /// Connection between the endpoints    );    /**Encode a sample block into the buffer specified.       The samples have been read and are waiting in the readBuffer member       variable. it is expected this function will encode exactly       encodedBlockSize bytes.     */    virtual BOOL EncodeFrame(      BYTE * buffer,    /// Buffer into which encoded bytes are placed      unsigned & length /// Actual length of encoded data buffer    );    /**Decode a sample block from the buffer specified.       The samples must be placed into the writeBuffer member variable. It is       expected that no more than frameSamples is decoded. The return value       is the number of samples decoded. Zero indicates an error.     */    virtual BOOL DecodeFrame(      const BYTE * buffer,  /// Buffer from which encoded data is found      unsigned length,      /// Length of encoded data buffer      unsigned & written    /// Number of bytes used from data buffer    );  protected:    PWaveFormat waveFormat;    HACMSTREAM  hStream;};#endif // __ACM_CODEC_H/////////////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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