Gnash
0.8.10
|
00001 // 00002 // Copyright (C) 2008, 2009, 2010, 2011, 2012 00003 // 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 #include "AudioDecoder.h" 00020 00021 #ifdef HAVE_CONFIG_H 00022 # include "gnashconfig.h" 00023 #endif 00024 #include <speex/speex.h> 00025 00026 #ifdef RESAMPLING_SPEEX 00027 # include <speex/speex_resampler.h> 00028 #endif 00029 00030 #ifndef GNASH_MEDIA_DECODER_SPEEX 00031 #define GNASH_MEDIA_DECODER_SPEEX 00032 00033 namespace gnash { 00034 namespace media { 00035 00037 // 00040 class AudioDecoderSpeex : public AudioDecoder 00041 { 00042 public: 00043 AudioDecoderSpeex(); 00044 ~AudioDecoderSpeex(); 00045 00046 boost::uint8_t* decode(const EncodedAudioFrame& input, 00047 boost::uint32_t& outputSize); 00048 00049 private: 00050 00051 SpeexBits _speex_bits; 00052 void* _speex_dec_state; 00053 int _speex_framesize; 00054 00055 #ifdef RESAMPLING_SPEEX 00056 SpeexResamplerState* _resampler; 00058 boost::uint32_t _target_frame_size; 00059 #endif 00060 }; 00061 00062 } // namespace media 00063 } // namespace gnash 00064 00065 #endif // GNASH_MEDIA_DECODER_SPEEX