📄 gsmcodec.h
字号:
/* * gsmcodec.h * * H.323 protocol handler * * Open H323 Library * * Copyright (c) 1999-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: gsmcodec.h,v $ * Revision 1.7 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.6 2000/05/02 04:32:24 robertj * Fixed copyright notice comment. * * Revision 1.5 1999/12/31 00:05:36 robertj * Added Microsoft ACM G.723.1 codec capability. * * Revision 1.4 1999/12/23 23:02:34 robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * * Revision 1.3 1999/10/08 09:59:01 robertj * Rewrite of capability for sending multiple audio frames * * Revision 1.2 1999/10/08 04:58:37 robertj * Added capability for sending multiple audio frames in single RTP packet * * Revision 1.1 1999/09/08 04:05:48 robertj * Added support for video capabilities & codec, still needs the actual codec itself! * */#ifndef __GSM_CODEC_H#define __GSM_CODEC_H#include "h323caps.h"/**This class describes the GSM 06.10 codec capability. */class H323_GSM0610Capability : public H323AudioCapability{ PCLASSINFO(H323_GSM0610Capability, H323AudioCapability) public: /**@name Construction */ //@{ /**Create a new GSM 06.10 capability. */ H323_GSM0610Capability(); //@} /**@name Overrides from class PObject */ //@{ /**Create a copy of the object. */ virtual PObject * Clone() 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 Identification functions */ //@{ /**Get the sub-type of the capability. This is a code dependent on the main type of the capability. This returns one of the four possible combinations of mode and speed using the enum values of the protocol ASN H245_AudioCapability class. */ virtual unsigned GetSubType() const; /**Get the name of the media data format this class represents. */ virtual PString GetFormatName() 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 ); //@}};struct gsm_state;/**This class is a GSM 06.10 codec. */class H323_GSM0610Codec : public H323FramedAudioCodec{ PCLASSINFO(H323_GSM0610Codec, H323FramedAudioCodec) public: enum { SamplesPerFrame = 160, // 20 milliseconds BytesPerFrame = 33 // Encoded size }; /**@name Construction */ //@{ /**Create a new GSM 06.10 codec for ALaw. */ H323_GSM0610Codec( Direction direction /// Direction in which this instance runs ); ~H323_GSM0610Codec(); //@} /**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: struct gsm_state * gsm;};#endif // __GSM_CODEC_H/////////////////////////////////////////////////////////////////////////////
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -