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 #ifndef __OPAL_G711CODEC_H
00031 #define __OPAL_G711CODEC_H
00032
00033 #ifdef P_USE_PRAGMA
00034 #pragma interface
00035 #endif
00036
00037
00038 #include <opal/transcoders.h>
00039 #include <codec/g711a1_plc.h>
00040
00041
00043
00044 class Opal_G711_uLaw_PCM : public OpalStreamedTranscoder {
00045 public:
00046 Opal_G711_uLaw_PCM();
00047 virtual int ConvertOne(int sample) const;
00048 static int ConvertSample(int sample);
00049
00050 #if OPAL_G711PLC
00051 virtual PBoolean Convert(
00052 const RTP_DataFrame & input,
00053 RTP_DataFrame & output
00054 );
00055
00056 protected:
00057 OpalG711_PLC plc;
00058 PINDEX lastPayloadSize;
00059 #endif
00060 };
00061
00062
00064
00065 class Opal_PCM_G711_uLaw : public OpalStreamedTranscoder {
00066 public:
00067 Opal_PCM_G711_uLaw();
00068 virtual int ConvertOne(int sample) const;
00069 static int ConvertSample(int sample);
00070 };
00071
00072
00074
00075 class Opal_G711_ALaw_PCM : public OpalStreamedTranscoder {
00076 public:
00077 Opal_G711_ALaw_PCM();
00078 virtual int ConvertOne(int sample) const;
00079 static int ConvertSample(int sample);
00080
00081 #if OPAL_G711PLC
00082 virtual PBoolean Convert(
00083 const RTP_DataFrame & input,
00084 RTP_DataFrame & output
00085 );
00086
00087 protected:
00088 OpalG711_PLC plc;
00089 PINDEX lastPayloadSize;
00090 #endif
00091 };
00092
00093
00095
00096 class Opal_PCM_G711_ALaw : public OpalStreamedTranscoder {
00097 public:
00098 Opal_PCM_G711_ALaw();
00099 virtual int ConvertOne(int sample) const;
00100 static int ConvertSample(int sample);
00101 };
00102
00103
00105
00106 #define OPAL_REGISTER_G711() \
00107 OPAL_REGISTER_TRANSCODER(Opal_G711_uLaw_PCM, OpalG711_ULAW_64K, OpalPCM16); \
00108 OPAL_REGISTER_TRANSCODER(Opal_PCM_G711_uLaw, OpalPCM16, OpalG711_ULAW_64K); \
00109 OPAL_REGISTER_TRANSCODER(Opal_G711_ALaw_PCM, OpalG711_ALAW_64K, OpalPCM16); \
00110 OPAL_REGISTER_TRANSCODER(Opal_PCM_G711_ALaw, OpalPCM16, OpalG711_ALAW_64K)
00111
00112 #endif // __OPAL_G711CODEC_H
00113
00114