Gnash
0.8.10
|
00001 // AudioDecoderSimple.h: Audio decoding using "simple" internal decoders. 00002 // 00003 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 00004 // Free Software Foundation, Inc. 00005 // 00006 // This program is free software; you can redistribute it and/or modify 00007 // it under the terms of the GNU General Public License as published by 00008 // the Free Software Foundation; either version 3 of the License, or 00009 // (at your option) any later version. 00010 // 00011 // This program is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 // GNU General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU General Public License 00017 // along with this program; if not, write to the Free Software 00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 00020 00021 #ifndef GNASH_AUDIODECODERSIMPLE_H 00022 #define GNASH_AUDIODECODERSIMPLE_H 00023 00024 #include "AudioDecoder.h" // for inheritance 00025 #include "MediaParser.h" // for audioCodecType enum (composition) 00026 00027 // Forward declarations 00028 namespace gnash { 00029 namespace media { 00030 class SoundInfo; 00031 class AudioInfo; 00032 } 00033 } 00034 00035 namespace gnash { 00036 namespace media { 00037 00039 class AudioDecoderSimple : public AudioDecoder { 00040 00041 public: 00042 00050 AudioDecoderSimple(const AudioInfo& info); 00051 00059 AudioDecoderSimple(const SoundInfo& info); 00060 00061 ~AudioDecoderSimple(); 00062 00063 // See dox in AudioDecoder.h 00064 boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize, boost::uint32_t& decodedBytes); 00065 00066 private: 00067 00068 // throws MediaException on failure 00069 void setup(const AudioInfo& info); 00070 00071 // throws MediaException on failure 00072 void setup(const SoundInfo& info); 00073 00074 // codec 00075 audioCodecType _codec; 00076 00077 // samplerate 00078 boost::uint16_t _sampleRate; 00079 00080 // sampleCount 00081 boost::uint32_t _sampleCount; 00082 00083 // stereo 00084 bool _stereo; 00085 00086 // samplesize: 8 or 16 bit 00087 bool _is16bit; 00088 00089 00090 // 00091 }; 00092 00093 } // gnash.media namespace 00094 } // gnash namespace 00095 00096 #endif // __AUDIODECODERSIMPLE_H__ 00097