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: 20373 $
00026  * $Author: rjongbloed $
00027  * $Date: 2008-06-03 13:15:06 +0000 (Tue, 03 Jun 2008) $
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 

Generated on Mon Sep 15 11:48:42 2008 for OPAL by  doxygen 1.5.1