Gnash 0.8.9
|
00001 // Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 00002 // 00003 // This program is free software; you can redistribute it and/or modify 00004 // it under the terms of the GNU General Public License as published by 00005 // the Free Software Foundation; either version 3 of the License, or 00006 // (at your option) any later version. 00007 // 00008 // This program is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 // GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License 00014 // along with this program; if not, write to the Free Software 00015 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00016 00017 #include "AudioDecoder.h" 00018 00019 #ifdef HAVE_CONFIG_H 00020 # include "gnashconfig.h" 00021 #endif 00022 #include <speex/speex.h> 00023 00024 #ifdef RESAMPLING_SPEEX 00025 # include <speex/speex_resampler.h> 00026 #endif 00027 00028 #ifndef GNASH_MEDIA_DECODER_SPEEX 00029 #define GNASH_MEDIA_DECODER_SPEEX 00030 00031 namespace gnash { 00032 namespace media { 00033 00035 // 00038 class AudioDecoderSpeex : public AudioDecoder 00039 { 00040 public: 00041 AudioDecoderSpeex(); 00042 ~AudioDecoderSpeex(); 00043 00044 boost::uint8_t* decode(const EncodedAudioFrame& input, 00045 boost::uint32_t& outputSize); 00046 00047 private: 00048 00049 SpeexBits _speex_bits; 00050 void* _speex_dec_state; 00051 int _speex_framesize; 00052 00053 #ifdef RESAMPLING_SPEEX 00054 SpeexResamplerState* _resampler; 00056 boost::uint32_t _target_frame_size; 00057 #endif 00058 }; 00059 00060 } // namespace media 00061 } // namespace gnash 00062 00063 #endif // GNASH_MEDIA_DECODER_SPEEX