00001 /* 00002 * lpc10codec.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 * Contributor(s): ______________________________________. 00025 * 00026 * $Log: lpc10codec.h,v $ 00027 * Revision 2.10 2005/11/30 13:35:26 csoutheren 00028 * Changed tags for Doxygen 00029 * 00030 * Revision 2.9 2005/08/28 07:59:17 rjongbloed 00031 * Converted OpalTranscoder to use factory, requiring sme changes in making sure 00032 * OpalMediaFormat instances are initialised before use. 00033 * 00034 * Revision 2.8 2005/02/21 12:19:45 rjongbloed 00035 * Added new "options list" to the OpalMediaFormat class. 00036 * 00037 * Revision 2.7 2004/09/01 12:21:27 rjongbloed 00038 * Added initialisation of H323EndPoints capability table to be all codecs so can 00039 * correctly build remote caps from fqast connect params. This had knock on effect 00040 * with const keywords added in numerous places. 00041 * 00042 * Revision 2.6 2002/11/10 23:22:17 robertj 00043 * Cosmetic change 00044 * 00045 * Revision 2.5 2002/11/10 11:33:16 robertj 00046 * Updated to OpenH323 v1.10.3 00047 * 00048 * Revision 2.4 2002/09/16 02:52:33 robertj 00049 * Added #define so can select if #pragma interface/implementation is used on 00050 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00051 * 00052 * Revision 2.3 2002/09/04 06:01:46 robertj 00053 * Updated to OpenH323 v1.9.6 00054 * 00055 * Revision 2.2 2001/11/02 10:45:19 robertj 00056 * Updated to OpenH323 v1.7.3 00057 * 00058 * Revision 2.1 2001/08/01 05:03:09 robertj 00059 * Changes to allow control of linking software transcoders, use macros 00060 * to force linking. 00061 * Allowed codecs to be used without H.,323 being linked by using the 00062 * new NO_H323 define. 00063 * Major changes to H.323 capabilities, uses OpalMediaFormat for base name. 00064 * 00065 * Revision 2.0 2001/07/27 15:48:24 robertj 00066 * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL) 00067 * 00068 * Revision 1.9 2002/09/16 01:14:15 robertj 00069 * Added #define so can select if #pragma interface/implementation is used on 00070 * platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan. 00071 * 00072 * Revision 1.8 2002/09/03 05:41:25 robertj 00073 * Normalised the multi-include header prevention ifdef/define symbol. 00074 * Added globally accessible functions for media format name. 00075 * 00076 * Revision 1.7 2002/08/14 19:35:08 rogerh 00077 * fix typo 00078 * 00079 * Revision 1.6 2002/08/05 10:03:47 robertj 00080 * Cosmetic changes to normalise the usage of pragma interface/implementation. 00081 * 00082 * Revision 1.5 2001/10/24 01:20:34 robertj 00083 * Added code to help with static linking of H323Capability names database. 00084 * 00085 * Revision 1.4 2001/02/09 05:16:24 robertj 00086 * Added #pragma interface for GNU C++. 00087 * 00088 * Revision 1.3 2001/01/25 07:27:14 robertj 00089 * Major changes to add more flexible OpalMediaFormat class to normalise 00090 * all information about media types, especially codecs. 00091 * 00092 * Revision 1.2 2000/06/10 09:04:56 rogerh 00093 * fix typo in a comment 00094 * 00095 * Revision 1.1 2000/06/05 04:45:02 robertj 00096 * Added LPC-10 2400bps codec 00097 * 00098 */ 00099 00100 #ifndef __OPAL_LPC10CODEC_H 00101 #define __OPAL_LPC10CODEC_H 00102 00103 #ifdef P_USE_PRAGMA 00104 #pragma interface 00105 #endif 00106 00107 00108 #include <opal/transcoders.h> 00109 00110 #ifndef NO_H323 00111 #include <h323/h323caps.h> 00112 #endif 00113 00114 00115 struct lpc10_encoder_state; 00116 struct lpc10_decoder_state; 00117 00118 #define OPAL_LPC10 "LPC-10" 00119 00120 extern const OpalAudioFormat & GetOpalLPC10(); 00121 00122 #define OpalLPC10 GetOpalLPC10() 00123 00124 00126 00127 #ifndef NO_H323 00128 00131 class H323_LPC10Capability : public H323NonStandardAudioCapability 00132 { 00133 PCLASSINFO(H323_LPC10Capability, H323NonStandardAudioCapability); 00134 00135 public: 00140 H323_LPC10Capability( 00141 const H323EndPoint & endpoint 00142 ); 00144 00149 virtual PObject * Clone() const; 00151 00156 virtual PString GetFormatName() const; 00158 }; 00159 00160 00161 #ifdef H323_STATIC_LIB 00162 H323_STATIC_LOAD_REGISTER_CAPABILITY(H323_LPC10Capability); 00163 #endif 00164 00165 00166 #define OPAL_REGISTER_LPC10_H323 \ 00167 H323_REGISTER_CAPABILITY_EP(H323_LPC10Capability, OPAL_LPC10) 00168 00169 00170 #else // ifndef NO_H323 00171 00172 #define OPAL_REGISTER_LPC10_H323 00173 00174 #endif // ifndef NO_H323 00175 00176 00178 00179 class Opal_LPC10_PCM : public OpalFramedTranscoder { 00180 public: 00181 Opal_LPC10_PCM(); 00182 ~Opal_LPC10_PCM(); 00183 virtual BOOL ConvertFrame(const BYTE * src, BYTE * dst); 00184 protected: 00185 struct lpc10_decoder_state * decoder; 00186 }; 00187 00188 00189 class Opal_PCM_LPC10 : public OpalFramedTranscoder { 00190 public: 00191 Opal_PCM_LPC10(); 00192 ~Opal_PCM_LPC10(); 00193 virtual BOOL ConvertFrame(const BYTE * src, BYTE * dst); 00194 protected: 00195 struct lpc10_encoder_state * encoder; 00196 }; 00197 00198 00200 00201 #define OPAL_REGISTER_LPC10() \ 00202 OPAL_REGISTER_LPC10_H323 \ 00203 OPAL_REGISTER_TRANSCODER(Opal_LPC10_PCM, OpalLPC10, OpalPCM16); \ 00204 OPAL_REGISTER_TRANSCODER(Opal_PCM_LPC10, OpalPCM16, OpalLPC10) 00205 00206 00207 #endif // __OPAL_LPC10CODEC_H 00208 00209