• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

AudioDecoderFfmpeg.h

Go to the documentation of this file.
00001 // AudioDecoderFfmpeg.h: Audio decoding using the FFMPEG library.
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_AUDIODECODERFFMPEG_H
00021 #define GNASH_AUDIODECODERFFMPEG_H
00022 
00023 #include "ffmpegHeaders.h"
00024 
00025 #include "log.h"
00026 #include "AudioDecoder.h" // for inheritance
00027 #include "AudioResamplerFfmpeg.h" // for composition
00028 
00029 // Forward declarations
00030 namespace gnash {
00031     namespace media {
00032         class SoundInfo;
00033         class AudioInfo;
00034     }
00035 }
00036 
00037 namespace gnash {
00038 namespace media {
00039 namespace ffmpeg {
00040 
00042 class AudioDecoderFfmpeg : public AudioDecoder {
00043         
00044 public:
00049         AudioDecoderFfmpeg(const AudioInfo& info);
00050 
00055         AudioDecoderFfmpeg(SoundInfo& info);
00056         ~AudioDecoderFfmpeg();
00057 
00058     // See dox in AudioDecoder.h
00059         boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize, boost::uint32_t& decodedBytes, bool parse);
00060 
00061         boost::uint8_t* decode(const EncodedAudioFrame& af, boost::uint32_t& outputSize);
00062 
00063 private:
00064 
00065         void setup(const AudioInfo& info);
00066         void setup(SoundInfo& info);
00067 
00068         boost::uint8_t* decodeFrame(const boost::uint8_t* input, boost::uint32_t inputSize, boost::uint32_t& outputSize);
00069 
00070         AVCodec* _audioCodec;
00071         AVCodecContext* _audioCodecCtx;
00072         AVCodecParserContext* _parser;
00073 
00074         // Use for resampling audio
00075         AudioResamplerFfmpeg _resampler;
00076 
00078     bool _needsParsing;
00079 
00081     //
00098     int parseInput(const boost::uint8_t* input, boost::uint32_t inputSize,
00099             boost::uint8_t const ** outFrame, int* outFrameSize);
00100 };
00101         
00102 } // gnash.media.ffmpeg namespace 
00103 } // gnash.media namespace 
00104 } // gnash namespace
00105 
00106 #endif // __AUDIODECODERFFMPEG_H__

Generated on Fri Mar 16 2012 15:46:08 for Gnash by  doxygen 1.7.1