00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
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