00001 /* 00002 * gsmcodec.h 00003 * 00004 * H.323 protocol handler 00005 * 00006 * Open H323 Library 00007 * 00008 * Copyright (c) 1999-2001 Equivalence Pty. Ltd. 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 H323 Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * 00024 * Portions of this code were written with the assisance of funding from 00025 * Vovida Networks, Inc. http://www.vovida.com. 00026 * 00027 * Contributor(s): ______________________________________. 00028 * 00029 * $Log: gsmcodec.h,v $ 00030 * Revision 2.7.2.1 2006/02/22 12:15:26 csoutheren 00031 * Backports from CVS head 00032 * 00033 * Revision 2.8 2006/02/09 22:48:40 csoutheren 00034 * Experimental fix for receiving MSGSM in GSM codec 00035 * 00036 * Revision 2.7 2005/11/30 13:35:26 csoutheren 00037 * Changed tags for Doxygen 00038 * 00039 * Revision 2.6 2005/08/28 07:59:17 rjongbloed 00040 * Converted OpalTranscoder to use factory, requiring sme changes in making sure 00041 * OpalMediaFormat instances are initialised before use. 00042 * 00043 * Revision 2.5 2002/11/10 11:33:16 robertj 00044 * Updated to OpenH323 v1.10.3 00045 * 00046 * Revision 2.4 2002/09/16 02:52:33 robertj 00047 * Added #define so can select if #pragma interface/implementation is used on 00048 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00049 * 00050 * Revision 2.3 2002/09/04 06:01:46 robertj 00051 * Updated to OpenH323 v1.9.6 00052 * 00053 * Revision 2.2 2001/11/02 10:45:19 robertj 00054 * Updated to OpenH323 v1.7.3 00055 * 00056 * Revision 2.1 2001/08/01 05:03:09 robertj 00057 * Changes to allow control of linking software transcoders, use macros 00058 * to force linking. 00059 * Allowed codecs to be used without H.,323 being linked by using the 00060 * new NO_H323 define. 00061 * Major changes to H.323 capabilities, uses OpalMediaFormat for base name. 00062 * 00063 * Revision 2.0 2001/07/27 15:48:24 robertj 00064 * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL) 00065 * 00066 * Revision 1.14 2002/09/16 01:14:15 robertj 00067 * Added #define so can select if #pragma interface/implementation is used on 00068 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00069 * 00070 * Revision 1.13 2002/09/03 06:19:36 robertj 00071 * Normalised the multi-include header prevention ifdef/define symbol. 00072 * 00073 * Revision 1.12 2002/08/05 10:03:47 robertj 00074 * Cosmetic changes to normalise the usage of pragma interface/implementation. 00075 * 00076 * Revision 1.11 2001/10/24 01:20:34 robertj 00077 * Added code to help with static linking of H323Capability names database. 00078 * 00079 * Revision 1.10 2001/02/11 22:48:30 robertj 00080 * Added #pragma interface for GNU C++. 00081 * 00082 * Revision 1.9 2001/01/25 07:27:14 robertj 00083 * Major changes to add more flexible OpalMediaFormat class to normalise 00084 * all information about media types, especially codecs. 00085 * 00086 * Revision 1.8 2000/10/13 03:43:14 robertj 00087 * Added clamping to avoid ever setting incorrect tx frame count. 00088 * 00089 * Revision 1.7 2000/05/10 04:05:26 robertj 00090 * Changed capabilities so has a function to get name of codec, instead of relying on PrintOn. 00091 * 00092 * Revision 1.6 2000/05/02 04:32:24 robertj 00093 * Fixed copyright notice comment. 00094 * 00095 * Revision 1.5 1999/12/31 00:05:36 robertj 00096 * Added Microsoft ACM G.723.1 codec capability. 00097 * 00098 * Revision 1.4 1999/12/23 23:02:34 robertj 00099 * File reorganision for separating RTP from H.323 and creation of LID for VPB support. 00100 * 00101 * Revision 1.3 1999/10/08 09:59:01 robertj 00102 * Rewrite of capability for sending multiple audio frames 00103 * 00104 * Revision 1.2 1999/10/08 04:58:37 robertj 00105 * Added capability for sending multiple audio frames in single RTP packet 00106 * 00107 * Revision 1.1 1999/09/08 04:05:48 robertj 00108 * Added support for video capabilities & codec, still needs the actual codec itself! 00109 * 00110 */ 00111 00112 #ifndef __OPAL_GSMCODEC_H 00113 #define __OPAL_GSMCODEC_H 00114 00115 #ifdef P_USE_PRAGMA 00116 #pragma interface 00117 #endif 00118 00119 00120 #include <opal/transcoders.h> 00121 00122 00124 00125 struct gsm_state; 00126 00127 class Opal_GSM0610 : public OpalFramedTranscoder { 00128 public: 00129 Opal_GSM0610( 00130 const OpalMediaFormat & inputMediaFormat, 00131 const OpalMediaFormat & outputMediaFormat, 00132 unsigned inputBytesPerFrame, 00133 unsigned outputBytesPerFrame 00134 ); 00135 ~Opal_GSM0610(); 00136 protected: 00137 gsm_state * gsm; 00138 }; 00139 00140 00142 00143 class Opal_GSM0610_PCM : public Opal_GSM0610 { 00144 public: 00145 Opal_GSM0610_PCM(); 00146 BOOL Convert(const RTP_DataFrame & input, RTP_DataFrame & output); 00147 BOOL ConvertFrame(const BYTE * src, BYTE * dst); 00148 }; 00149 00150 00152 00153 class Opal_PCM_GSM0610 : public Opal_GSM0610 { 00154 public: 00155 Opal_PCM_GSM0610(); 00156 virtual BOOL ConvertFrame(const BYTE * src, BYTE * dst); 00157 }; 00158 00159 00161 00162 #define OPAL_REGISTER_GSM0610() \ 00163 OPAL_REGISTER_TRANSCODER(Opal_GSM0610_PCM, OpalGSM0610, OpalPCM16); \ 00164 OPAL_REGISTER_TRANSCODER(Opal_PCM_GSM0610, OpalPCM16, OpalGSM0610) 00165 00166 00167 00168 #endif // __OPAL_GSMCODEC_H 00169 00170