1 // AudioDecoderSimple.h: Audio decoding using "simple" internal decoders.
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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.
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
37 /// Audio decoding using "simple" internal decoders.
38 class AudioDecoderSimple
: public AudioDecoder
{
43 /// AudioInfo class with all the info needed to decode
44 /// the sound correctly. Throws a MediaException on fatal
47 /// @throws MediaException on failure
49 AudioDecoderSimple(const AudioInfo
& info
);
52 /// SoundInfo class with all the info needed to decode
53 /// the sound correctly. Throws a MediaException on fatal
56 /// @throws MediaException on failure
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
);
67 // throws MediaException on failure
68 void setup(const AudioInfo
& info
);
70 // throws MediaException on failure
71 void setup(const SoundInfo
& info
);
74 audioCodecType _codec
;
77 boost::uint16_t _sampleRate
;
80 boost::uint32_t _sampleCount
;
85 // samplesize: 8 or 16 bit
92 } // gnash.media namespace
95 #endif // __AUDIODECODERSIMPLE_H__