00001 // AudioDecoderHaiku.h: Audio decoding using the Haiku media kit. 00002 // 00003 // Copyright (C) 2007, 2008, 2009, 2010 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_AUDIODECODERHAIKU_H 00021 #define GNASH_AUDIODECODERHAIKU_H 00022 00023 #include "log.h" 00024 #include "AudioDecoder.h" // for inheritance 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 namespace haiku { 00037 00039 class AudioDecoderHaiku : public AudioDecoder { 00040 00041 public: 00046 AudioDecoderHaiku(const AudioInfo& info); 00047 00052 AudioDecoderHaiku(SoundInfo& info); 00053 ~AudioDecoderHaiku(); 00054 00055 // See dox in AudioDecoder.h 00056 boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize, boost::uint32_t& decodedBytes, bool parse); 00057 00058 boost::uint8_t* decode(const EncodedAudioFrame& af, boost::uint32_t& outputSize); 00059 00060 private: 00061 // 00062 // void setup(const AudioInfo& info); 00063 // void setup(SoundInfo& info); 00064 // 00065 // boost::uint8_t* decodeFrame(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize); 00066 // 00067 // AVCodec* _audioCodec; 00068 // AVCodecContext* _audioCodecCtx; 00069 // AVCodecParserContext* _parser; 00070 // 00071 // // Use for resampling audio 00072 // AudioResamplerFfmpeg _resampler; 00073 // 00074 // /// True if a parser is required to decode the format 00075 // bool _needsParsing; 00076 // 00077 // /// Parse input 00078 // // 00079 // /// @param input 00080 // /// Pointer to frame we want to start parsing at. 00081 // /// 00082 // /// @param inputSize 00083 // /// Number of bytes available in input 00084 // /// 00085 // /// @param outFrame 00086 // /// Output parameter, will be set to the start 00087 // /// of first frame found in input. 00088 // /// 00089 // /// @param outFrameSize 00090 // /// Output parameter, will be set to size in bytes 00091 // /// of the first frame found. 00092 // /// 00093 // /// @return number of input bytes parsed, or -1 on error 00094 // /// 00095 // int parseInput(const boost::uint8_t* input, boost::uint32_t inputSize, 00096 // boost::uint8_t const ** outFrame, int* outFrameSize); 00097 }; 00098 00099 } // gnash.media.haiku namespace 00100 } // gnash.media namespace 00101 } // gnash namespace 00102 00103 #endif // __AUDIODECODERHAIKU_H__