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