Add patch to fix #35635, mmap problems with a hardened kernel.
[gnash.git] / libmedia / AudioDecoderSpeex.h
blob5e7d85a6a0f4e13c039eca5cf08186eaed3d8845
1 //
2 // Copyright (C) 2008, 2009, 2010, 2011, 2012
3 // Free Software Foundation, Inc.
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #include "AudioDecoder.h"
21 #ifdef HAVE_CONFIG_H
22 # include "gnashconfig.h"
23 #endif
24 #include <speex/speex.h>
26 #ifdef RESAMPLING_SPEEX
27 # include <speex/speex_resampler.h>
28 #endif
30 #ifndef GNASH_MEDIA_DECODER_SPEEX
31 #define GNASH_MEDIA_DECODER_SPEEX
33 namespace gnash {
34 namespace media {
36 /// Audio decoder for the speex codec
38 /// This class will use the speex resampler if available
39 ///
40 class AudioDecoderSpeex : public AudioDecoder
42 public:
43 AudioDecoderSpeex();
44 ~AudioDecoderSpeex();
46 boost::uint8_t* decode(const EncodedAudioFrame& input,
47 boost::uint32_t& outputSize);
49 private:
51 SpeexBits _speex_bits;
52 void* _speex_dec_state;
53 int _speex_framesize;
55 #ifdef RESAMPLING_SPEEX
56 SpeexResamplerState* _resampler;
57 /// Number of samples in a resampled 44kHz stereo frame.
58 boost::uint32_t _target_frame_size;
59 #endif
62 } // namespace media
63 } // namespace gnash
65 #endif // GNASH_MEDIA_DECODER_SPEEX