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.h
AudioDecoder.h
gnash::key::i
@ i
Definition: GnashKey.h:155
_
#define _(String)
Definition: log.h:44
gnash
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
gnash::media::AudioDecoderSpeex::AudioDecoderSpeex
AudioDecoderSpeex()
Definition: AudioDecoderSpeex.cpp:36
AudioResampler.h
gnash::media::EncodedAudioFrame
An encoded audio frame.
Definition: MediaParser.h:454
gnash::log_error
void log_error(StringType msg, Args... args)
Definition: log.h:283
gnash::media::AudioDecoder
Audio decoding base class.
Definition: AudioDecoder.h:36
gnash::media::AudioResampler::convert_raw_data
static void convert_raw_data(std::int16_t **adjusted_data, int *adjusted_size, void *data, int sample_count, int sample_size, int sample_rate, bool stereo, int m_sample_rate, bool m_stereo)
VERY crude sample-rate and stereo conversion.
Definition: AudioResampler.cpp:29
MediaParser.h
gnash::media::AudioDecoderSpeex::decode
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
log.h
gnashconfig.h
gnash::media::EncodedAudioFrame::dataSize
std::uint32_t dataSize
Definition: MediaParser.h:456
gnash::media::EncodedAudioFrame::data
std::unique_ptr< std::uint8_t[]> data
Definition: MediaParser.h:457
gnash::media::AudioDecoderSpeex::~AudioDecoderSpeex
~AudioDecoderSpeex()
Definition: AudioDecoderSpeex.cpp:68
gnash::media::AudioDecoderSpeex
Audio decoder for the speex codec.
Definition: AudioDecoderSpeex.h:41
GnashException.h
gnash::MediaException
An exception from MediaHandler subsystem.
Definition: GnashException.h:50
data
SimpleBuffer data
Definition: LocalConnection_as.cpp:151