Gnash  0.8.10
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, 2012
00004 //   Free Software Foundation, Inc.
00005 // 
00006 // This program is free software; you can redistribute it and/or modify
00007 // it under the terms of the GNU General Public License as published by
00008 // the Free Software Foundation; either version 3 of the License, or
00009 // (at your option) any later version.
00010 // 
00011 // This program is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014 // GNU General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU General Public License
00017 // along with this program; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 
00020 #ifndef GNASH_AUDIODECODERGST_H
00021 #define GNASH_AUDIODECODERGST_H
00022 
00023 #include "log.h"
00024 #include "AudioDecoder.h"
00025 
00026 #include <gst/gst.h>
00027 #include "GnashImage.h"
00028 
00029 #include "swfdec_codec_gst.h"
00030 
00031 // Forward declarations
00032 namespace gnash {
00033     namespace media {
00034         class AudioInfo;
00035         class SoundInfo;
00036     }
00037 }
00038 
00039 namespace gnash {
00040 namespace media {
00041 namespace gst {
00042 
00044 class DSOEXPORT AudioDecoderGst : public AudioDecoder {
00045         
00046 public:
00047     AudioDecoderGst(const AudioInfo& info);
00048     AudioDecoderGst(SoundInfo& info);
00049 
00050     ~AudioDecoderGst();
00051 
00052     boost::uint8_t* decode(const boost::uint8_t* input, boost::uint32_t inputSize,
00053                            boost::uint32_t& outputSize, boost::uint32_t& decodedData);
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