make sure revno.h exists before trying to grep it.
[gnash.git] / libmedia / AudioDecoderSimple.h
bloba1fbce0ced15188f85eb9ffe7f66c67de15fd0a5
1 // AudioDecoderSimple.h: Audio decoding using "simple" internal decoders.
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef GNASH_AUDIODECODERSIMPLE_H
21 #define GNASH_AUDIODECODERSIMPLE_H
23 #include "AudioDecoder.h" // for inheritance
24 #include "MediaParser.h" // for audioCodecType enum (composition)
26 // Forward declarations
27 namespace gnash {
28 namespace media {
29 class SoundInfo;
30 class AudioInfo;
34 namespace gnash {
35 namespace media {
37 /// Audio decoding using "simple" internal decoders.
38 class AudioDecoderSimple : public AudioDecoder {
40 public:
42 /// @param info
43 /// AudioInfo class with all the info needed to decode
44 /// the sound correctly. Throws a MediaException on fatal
45 /// error.
46 ///
47 /// @throws MediaException on failure
48 ///
49 AudioDecoderSimple(const AudioInfo& info);
51 /// @param info
52 /// SoundInfo class with all the info needed to decode
53 /// the sound correctly. Throws a MediaException on fatal
54 /// error.
55 ///
56 /// @throws MediaException on failure
57 ///
58 AudioDecoderSimple(const SoundInfo& info);
60 ~AudioDecoderSimple();
62 // See dox in AudioDecoder.h
63 boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize, boost::uint32_t& decodedBytes, bool parse);
65 private:
67 // throws MediaException on failure
68 void setup(const AudioInfo& info);
70 // throws MediaException on failure
71 void setup(const SoundInfo& info);
73 // codec
74 audioCodecType _codec;
76 // samplerate
77 boost::uint16_t _sampleRate;
79 // sampleCount
80 boost::uint32_t _sampleCount;
82 // stereo
83 bool _stereo;
85 // samplesize: 8 or 16 bit
86 bool _is16bit;
89 //
92 } // gnash.media namespace
93 } // gnash namespace
95 #endif // __AUDIODECODERSIMPLE_H__