g711codec.h

Go to the documentation of this file.
00001 /*
00002  * g711codec.h
00003  *
00004  * Open Phone Abstraction Library (OPAL)
00005  * Formally known as the Open H323 project.
00006  *
00007  * Copyright (c) 2001 Equivalence Pty. Ltd.
00008  *
00009  * The contents of this file are subject to the Mozilla Public License
00010  * Version 1.0 (the "License"); you may not use this file except in
00011  * compliance with the License. You may obtain a copy of the License at
00012  * http://www.mozilla.org/MPL/
00013  *
00014  * Software distributed under the License is distributed on an "AS IS"
00015  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00016  * the License for the specific language governing rights and limitations
00017  * under the License.
00018  *
00019  * The Original Code is Open Phone Abstraction Library.
00020  *
00021  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00022  *
00023  * Contributor(s): ______________________________________.
00024  *
00025  * $Revision: 21283 $
00026  * $Author: rjongbloed $
00027  * $Date: 2008-10-11 07:10:58 +0000 (Sat, 11 Oct 2008) $
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 

Generated on Mon Feb 23 02:01:06 2009 for OPAL by  doxygen 1.5.1