Gnash 0.8.10dev
AudioDecoderGst.h
Go to the documentation of this file.
00001 // AudioDecoderGst.h: Audio decoding using Gstreamer.
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 #ifndef GNASH_AUDIODECODERGST_H
00020 #define GNASH_AUDIODECODERGST_H
00021 
00022 #include "log.h"
00023 #include "AudioDecoder.h"
00024 
00025 #include <gst/gst.h>
00026 #include "GnashImage.h"
00027 
00028 #include "swfdec_codec_gst.h"
00029 
00030 // Forward declarations
00031 namespace gnash {
00032     namespace media {
00033         class AudioInfo;
00034         class SoundInfo;
00035     }
00036 }
00037 
00038 namespace gnash {
00039 namespace media {
00040 namespace gst {
00041 
00043 class DSOEXPORT AudioDecoderGst : public AudioDecoder {
00044         
00045 public:
00046     AudioDecoderGst(const AudioInfo& info);
00047     AudioDecoderGst(SoundInfo& info);
00048 
00049     ~AudioDecoderGst();
00050 
00051     boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize,
00052                            boost::uint32_t& outputSize, boost::uint32_t& decodedData,
00053                            bool /*parse*/);
00054     boost::uint8_t* decode(const EncodedAudioFrame& ef, boost::uint32_t& outputSize);
00055 
00056 private:
00057 
00058     boost::uint8_t* pullBuffers(boost::uint32_t&  outputSize);
00059 
00060     void setup(GstCaps* caps);
00061 
00062     SwfdecGstDecoder _decoder;
00063 
00064 };
00065 
00066 } // gnash.media.gst namespace
00067 } // media namespace
00068 } // gnash namespace
00069 
00070 #endif // __AUDIODECODERGST_H__
00071