OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

g711codec.h
Go to the documentation of this file.
1 /*
2 * g711codec.h
3 *
4 * Open Phone Abstraction Library (OPAL)
5 * Formally known as the Open H323 project.
6 *
7 * Copyright (c) 2001 Equivalence Pty. Ltd.
8 *
9 * The contents of this file are subject to the Mozilla Public License
10 * Version 1.0 (the "License"); you may not use this file except in
11 * compliance with the License. You may obtain a copy of the License at
12 * http://www.mozilla.org/MPL/
13 *
14 * Software distributed under the License is distributed on an "AS IS"
15 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
16 * the License for the specific language governing rights and limitations
17 * under the License.
18 *
19 * The Original Code is Open Phone Abstraction Library.
20 *
21 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
22 *
23 * Contributor(s): ______________________________________.
24 *
25 * $Revision: 21988 $
26 * $Author: rjongbloed $
27 * $Date: 2009-02-04 00:28:03 -0600 (Wed, 04 Feb 2009) $
28 */
29
30 #ifndef OPAL_CODEC_G711CODEC_H
31 #define OPAL_CODEC_G711CODEC_H
32
33 #ifdef P_USE_PRAGMA
34 #pragma interface
35 #endif
36
37 #include <opal/buildopts.h>
38
39 #include <opal/transcoders.h>
40 #include <codec/g711a1_plc.h>
41
42
44
45 class Opal_G711_PCM : public OpalStreamedTranscoder {
46 public:
47 Opal_G711_PCM(const OpalMediaFormat & inputMediaFormat);
48
49 #if OPAL_G711PLC
50 virtual PBoolean Convert(
51 const RTP_DataFrame & input,
52 RTP_DataFrame & output
53 );
54
55 protected:
56 OpalG711_PLC plc;
57 PINDEX lastPayloadSize;
58 #endif
59 };
60
61
63
64 class Opal_G711_uLaw_PCM : public Opal_G711_PCM {
65 public:
66 Opal_G711_uLaw_PCM();
67 virtual int ConvertOne(int sample) const;
68 static int ConvertSample(int sample);
69 };
70
71
73
74 class Opal_PCM_G711_uLaw : public OpalStreamedTranscoder {
75 public:
76 Opal_PCM_G711_uLaw();
77 virtual int ConvertOne(int sample) const;
78 static int ConvertSample(int sample);
79 };
80
81
83
84 class Opal_G711_ALaw_PCM : public Opal_G711_PCM {
85 public:
86 Opal_G711_ALaw_PCM();
87 virtual int ConvertOne(int sample) const;
88 static int ConvertSample(int sample);
89 };
90
91
93
94 class Opal_PCM_G711_ALaw : public OpalStreamedTranscoder {
95 public:
96 Opal_PCM_G711_ALaw();
97 virtual int ConvertOne(int sample) const;
98 static int ConvertSample(int sample);
99 };
100
101
103
104 #define OPAL_REGISTER_G711() \
105 OPAL_REGISTER_TRANSCODER(Opal_G711_uLaw_PCM, OpalG711_ULAW_64K, OpalPCM16); \
106 OPAL_REGISTER_TRANSCODER(Opal_PCM_G711_uLaw, OpalPCM16, OpalG711_ULAW_64K); \
107 OPAL_REGISTER_TRANSCODER(Opal_G711_ALaw_PCM, OpalG711_ALAW_64K, OpalPCM16); \
108 OPAL_REGISTER_TRANSCODER(Opal_PCM_G711_ALaw, OpalPCM16, OpalG711_ALAW_64K)
109
110 #endif // OPAL_CODEC_G711CODEC_H
111
112