ilbccodec.h

Go to the documentation of this file.
00001 /*
00002  * ilbc.h
00003  *
00004  * Internet Low Bitrate Codec
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 1999-2000 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: ilbccodec.h,v $
00027  * Revision 2.5  2005/08/28 07:59:17  rjongbloed
00028  * Converted OpalTranscoder to use factory, requiring sme changes in making sure
00029  *   OpalMediaFormat instances are initialised before use.
00030  *
00031  * Revision 2.4  2005/02/21 12:19:45  rjongbloed
00032  * Added new "options list" to the OpalMediaFormat class.
00033  *
00034  * Revision 2.3  2004/09/01 12:21:26  rjongbloed
00035  * Added initialisation of H323EndPoints capability table to be all codecs so can
00036  *   correctly build remote caps from fqast connect params. This had knock on effect
00037  *   with const keywords added in numerous places.
00038  *
00039  * Revision 2.2  2004/04/25 09:27:33  rjongbloed
00040  * Fixed correct H.323 capability definitions for iLBC codec variants
00041  *
00042  * Revision 2.1  2004/02/19 10:46:43  rjongbloed
00043  * Merged OpenH323 version 1.13.1 changes.
00044  *
00045  * Revision 1.1  2003/06/06 02:19:04  rjongbloed
00046  * Added iLBC codec
00047  *
00048  */
00049 
00050 #ifndef __OPAL_ILBC_H
00051 #define __OPAL_ILBC_H
00052 
00053 #ifdef P_USE_PRAGMA
00054 #pragma interface
00055 #endif
00056 
00057 
00058 #include <opal/transcoders.h>
00059 
00060 #ifndef NO_H323
00061 #include <h323/h323caps.h>
00062 #endif
00063 
00064 
00065 struct iLBC_Enc_Inst_t_;
00066 struct iLBC_Dec_Inst_t_;
00067 
00068 
00069 #define OPAL_ILBC_13k3 "iLBC-13k3"
00070 #define OPAL_ILBC_15k2 "iLBC-15k2"
00071 
00072 extern const OpalAudioFormat & GetOpal_iLBC_13k3();
00073 extern const OpalAudioFormat & GetOpal_iLBC_15k2();
00074 
00075 #define Opal_iLBC_13k3 GetOpal_iLBC_13k3()
00076 #define Opal_iLBC_15k2 GetOpal_iLBC_15k2()
00077 
00078 
00080 
00081 #ifndef NO_H323
00082 
00085 class H323_iLBC_Capability : public H323NonStandardAudioCapability
00086 {
00087   PCLASSINFO(H323_iLBC_Capability, H323NonStandardAudioCapability)
00088 
00089   public:
00092     enum Speed {
00093       e_13k3,
00094       e_15k2
00095     };
00096 
00099     H323_iLBC_Capability(
00100       const H323EndPoint & endpoint,
00101       Speed speed
00102     );
00104 
00109     virtual PObject * Clone() const;
00111 
00116     virtual PString GetFormatName() const;
00118 
00119   private:
00120     Speed speed;
00121 };
00122 
00123 
00124 #ifdef H323_STATIC_LIB
00125 H323_STATIC_LOAD_REGISTER_CAPABILITY(H323_ILBC_13k3_Capability);
00126 H323_STATIC_LOAD_REGISTER_CAPABILITY(H323_ILBC_15k2_Capability);
00127 #endif
00128 
00129 
00130 #define OPAL_REGISTER_iLBC_H323 \
00131   H323_REGISTER_CAPABILITY_FUNCTION(H323_ILBC_13k3_Capability, OPAL_ILBC_13k3, ep) \
00132     { return new H323_iLBC_Capability(ep, H323_iLBC_Capability::e_13k3); } \
00133   H323_REGISTER_CAPABILITY_FUNCTION(H323_ILBC_15k2_Capability, OPAL_ILBC_15k2, ep) \
00134     { return new H323_iLBC_Capability(ep, H323_iLBC_Capability::e_15k2); }
00135 
00136 
00137 #else // ifndef NO_H323
00138 
00139 #define OPAL_REGISTER_iLBC_H323
00140 
00141 #endif // ifndef NO_H323
00142 
00143 
00144 class Opal_iLBC_Decoder : public OpalFramedTranscoder {
00145   public:
00146     Opal_iLBC_Decoder(
00147       const OpalMediaFormat & inputMediaFormat,
00148       int speed
00149     );
00150     ~Opal_iLBC_Decoder();
00151     virtual BOOL ConvertFrame(const BYTE * src, BYTE * dst);
00152   protected:
00153     struct iLBC_Dec_Inst_t_ * decoder; 
00154 };
00155 
00156 
00157 class Opal_iLBC_13k3_PCM : public Opal_iLBC_Decoder {
00158   public:
00159     Opal_iLBC_13k3_PCM();
00160 };
00161 
00162 
00163 class Opal_iLBC_15k2_PCM : public Opal_iLBC_Decoder {
00164   public:
00165     Opal_iLBC_15k2_PCM();
00166 };
00167 
00168 
00169 class Opal_iLBC_Encoder : public OpalFramedTranscoder {
00170   public:
00171     Opal_iLBC_Encoder(
00172       const OpalMediaFormat & outputMediaFormat,
00173       int speed
00174     );
00175     ~Opal_iLBC_Encoder();
00176     virtual BOOL ConvertFrame(const BYTE * src, BYTE * dst);
00177   protected:
00178     struct iLBC_Enc_Inst_t_ * encoder; 
00179 };
00180 
00181 
00182 class Opal_PCM_iLBC_13k3 : public Opal_iLBC_Encoder {
00183   public:
00184     Opal_PCM_iLBC_13k3();
00185 };
00186 
00187 
00188 class Opal_PCM_iLBC_15k2 : public Opal_iLBC_Encoder {
00189   public:
00190     Opal_PCM_iLBC_15k2();
00191 };
00192 
00193 
00195 
00196 #define OPAL_REGISTER_iLBC() \
00197           OPAL_REGISTER_iLBC_H323 \
00198           OPAL_REGISTER_TRANSCODER(Opal_iLBC_13k3_PCM, Opal_iLBC_13k3, OpalPCM16); \
00199           OPAL_REGISTER_TRANSCODER(Opal_PCM_iLBC_13k3, OpalPCM16,      Opal_iLBC_13k3); \
00200           OPAL_REGISTER_TRANSCODER(Opal_iLBC_15k2_PCM, Opal_iLBC_15k2, OpalPCM16); \
00201           OPAL_REGISTER_TRANSCODER(Opal_PCM_iLBC_15k2, OpalPCM16,      Opal_iLBC_15k2)
00202 
00203 
00204 #endif // __OPAL_ILBC_H
00205 
00206 

Generated on Mon Sep 25 16:20:07 2006 for OPAL by  doxygen 1.4.7