Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
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"
00027 #include "AudioResamplerFfmpeg.h"
00028
00029
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
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
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 }
00103 }
00104 }
00105
00106 #endif // __AUDIODECODERFFMPEG_H__