Gnash  0.8.11dev
AudioDecoderSpeex.h
Go to the documentation of this file.
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.
14 //
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
18 
19 #include "AudioDecoder.h"
20 
21 #ifdef HAVE_CONFIG_H
22 # include "gnashconfig.h"
23 #endif
24 #include <speex/speex.h>
25 
26 #ifdef RESAMPLING_SPEEX
27 # include <speex/speex_resampler.h>
28 #endif
29 
30 #ifndef GNASH_MEDIA_DECODER_SPEEX
31 #define GNASH_MEDIA_DECODER_SPEEX
32 
33 namespace gnash {
34 namespace media {
35 
37 //
41 {
42 public:
45 
46  std::uint8_t* decode(const EncodedAudioFrame& input,
47  std::uint32_t& outputSize);
48 
49 private:
50 
51  SpeexBits _speex_bits;
52  void* _speex_dec_state;
53  int _speex_framesize;
54 
55 #ifdef RESAMPLING_SPEEX
56  SpeexResamplerState* _resampler;
58  std::uint32_t _target_frame_size;
59 #endif
60 };
61 
62 } // namespace media
63 } // namespace gnash
64 
65 #endif // GNASH_MEDIA_DECODER_SPEEX
AudioDecoderSpeex()
Definition: AudioDecoderSpeex.cpp:36
An encoded audio frame.
Definition: MediaParser.h:453
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
std::uint8_t * decode(const EncodedAudioFrame &input, std::uint32_t &outputSize)
Decodes an EncodedAudioFrame and returns a pointer to the decoded data.
Definition: AudioDecoderSpeex.cpp:91
~AudioDecoderSpeex()
Definition: AudioDecoderSpeex.cpp:68
Audio decoder for the speex codec.
Definition: AudioDecoderSpeex.h:40
Audio decoding base class.
Definition: AudioDecoder.h:36