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