Gnash 0.8.9

AudioDecoderSimple.h

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