live
uLawAudioFilter.hh
Go to the documentation of this file.
1/**********
2This library is free software; you can redistribute it and/or modify it under
3the terms of the GNU Lesser General Public License as published by the
4Free Software Foundation; either version 3 of the License, or (at your
5option) any later version. (See <http://www.gnu.org/copyleft/lesser.html>.)
6
7This library is distributed in the hope that it will be useful, but WITHOUT
8ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
9FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
10more details.
11
12You should have received a copy of the GNU Lesser General Public License
13along with this library; if not, write to the Free Software Foundation, Inc.,
1451 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15**********/
16// "liveMedia"
17// Copyright (c) 1996-2024 Live Networks, Inc. All rights reserved.
18// Filters for converting between raw PCM audio and uLaw
19// C++ header
20
21#ifndef _ULAW_AUDIO_FILTER_HH
22#define _ULAW_AUDIO_FILTER_HH
23
24#ifndef _FRAMED_FILTER_HH
25#include "FramedFilter.hh"
26#endif
27
29
31public:
34 int byteOrdering = 0);
35 // "byteOrdering" == 0 => host order (the default)
36 // "byteOrdering" == 1 => little-endian order
37 // "byteOrdering" == 2 => network (i.e., big-endian) order
38
39protected:
41 int byteOrdering);
42 // called only by createNew()
44
45private:
46 // Redefined virtual functions:
47 virtual void doGetNextFrame();
48
49private:
50 static void afterGettingFrame(void* clientData, unsigned frameSize,
51 unsigned numTruncatedBytes,
52 struct timeval presentationTime,
53 unsigned durationInMicroseconds);
54 void afterGettingFrame1(unsigned frameSize,
55 unsigned numTruncatedBytes,
56 struct timeval presentationTime,
57 unsigned durationInMicroseconds);
58
59private:
61 unsigned char* fInputBuffer;
63};
64
65
67
69public:
72
73protected:
76 // called only by createNew()
78
79private:
80 // Redefined virtual functions:
81 virtual void doGetNextFrame();
82
83private:
84 static void afterGettingFrame(void* clientData, unsigned frameSize,
85 unsigned numTruncatedBytes,
86 struct timeval presentationTime,
87 unsigned durationInMicroseconds);
88 void afterGettingFrame1(unsigned frameSize,
89 unsigned numTruncatedBytes,
90 struct timeval presentationTime,
91 unsigned durationInMicroseconds);
92
93private:
94 unsigned char* fInputBuffer;
96};
97
98
100
102public:
105
106protected:
108 // called only by createNew()
110
111private:
112 // Redefined virtual functions:
113 virtual void doGetNextFrame();
114
115private:
116 static void afterGettingFrame(void* clientData, unsigned frameSize,
117 unsigned numTruncatedBytes,
118 struct timeval presentationTime,
119 unsigned durationInMicroseconds);
120 void afterGettingFrame1(unsigned frameSize,
121 unsigned numTruncatedBytes,
122 struct timeval presentationTime,
123 unsigned durationInMicroseconds);
124};
125
126
128
130public:
133
134protected:
136 // called only by createNew()
138
139private:
140 // Redefined virtual functions:
141 virtual void doGetNextFrame();
142
143private:
144 static void afterGettingFrame(void* clientData, unsigned frameSize,
145 unsigned numTruncatedBytes,
146 struct timeval presentationTime,
147 unsigned durationInMicroseconds);
148 void afterGettingFrame1(unsigned frameSize,
149 unsigned numTruncatedBytes,
150 struct timeval presentationTime,
151 unsigned durationInMicroseconds);
152};
153
154
156
158public:
160
161protected:
163 // called only by createNew()
164 virtual ~EndianSwap16();
165
166private:
167 // Redefined virtual functions:
168 virtual void doGetNextFrame();
169
170private:
171 static void afterGettingFrame(void* clientData, unsigned frameSize,
172 unsigned numTruncatedBytes,
173 struct timeval presentationTime,
174 unsigned durationInMicroseconds);
175 void afterGettingFrame1(unsigned frameSize,
176 unsigned numTruncatedBytes,
177 struct timeval presentationTime,
178 unsigned durationInMicroseconds);
179};
180
181
183
185public:
187
188protected:
190 // called only by createNew()
191 virtual ~EndianSwap24();
192
193private:
194 // Redefined virtual functions:
195 virtual void doGetNextFrame();
196
197private:
198 static void afterGettingFrame(void* clientData, unsigned frameSize,
199 unsigned numTruncatedBytes,
200 struct timeval presentationTime,
201 unsigned durationInMicroseconds);
202 void afterGettingFrame1(unsigned frameSize,
203 unsigned numTruncatedBytes,
204 struct timeval presentationTime,
205 unsigned durationInMicroseconds);
206};
207
208#endif
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
virtual ~EndianSwap16()
virtual void doGetNextFrame()
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
static EndianSwap16 * createNew(UsageEnvironment &env, FramedSource *inputSource)
EndianSwap16(UsageEnvironment &env, FramedSource *inputSource)
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
virtual ~EndianSwap24()
virtual void doGetNextFrame()
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
static EndianSwap24 * createNew(UsageEnvironment &env, FramedSource *inputSource)
EndianSwap24(UsageEnvironment &env, FramedSource *inputSource)
FramedSource * inputSource() const
Definition: FramedFilter.hh:30
static HostFromNetworkOrder16 * createNew(UsageEnvironment &env, FramedSource *inputSource)
virtual void doGetNextFrame()
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
virtual ~HostFromNetworkOrder16()
HostFromNetworkOrder16(UsageEnvironment &env, FramedSource *inputSource)
virtual void doGetNextFrame()
virtual ~NetworkFromHostOrder16()
static NetworkFromHostOrder16 * createNew(UsageEnvironment &env, FramedSource *inputSource)
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
NetworkFromHostOrder16(UsageEnvironment &env, FramedSource *inputSource)
virtual ~PCMFromuLawAudioSource()
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
virtual void doGetNextFrame()
static PCMFromuLawAudioSource * createNew(UsageEnvironment &env, FramedSource *inputSource)
PCMFromuLawAudioSource(UsageEnvironment &env, FramedSource *inputSource)
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
unsigned char * fInputBuffer
unsigned char * fInputBuffer
static void afterGettingFrame(void *clientData, unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
virtual void doGetNextFrame()
void afterGettingFrame1(unsigned frameSize, unsigned numTruncatedBytes, struct timeval presentationTime, unsigned durationInMicroseconds)
uLawFromPCMAudioSource(UsageEnvironment &env, FramedSource *inputSource, int byteOrdering)
virtual ~uLawFromPCMAudioSource()
static uLawFromPCMAudioSource * createNew(UsageEnvironment &env, FramedSource *inputSource, int byteOrdering=0)