Gnash  0.8.11dev
AudioDecoderSimple.h
Go to the documentation of this file.
1 // AudioDecoderSimple.h: Audio decoding using "simple" internal decoders.
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012
4 // Free Software Foundation, Inc.
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 3 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 
21 #ifndef GNASH_AUDIODECODERSIMPLE_H
22 #define GNASH_AUDIODECODERSIMPLE_H
23 
24 #include "AudioDecoder.h" // for inheritance
25 #include "MediaParser.h" // for audioCodecType enum (composition)
26 
27 // Forward declarations
28 namespace gnash {
29  namespace media {
30  class SoundInfo;
31  class AudioInfo;
32  }
33 }
34 
35 namespace gnash {
36 namespace media {
37 
40 
41 public:
42 
50  AudioDecoderSimple(const AudioInfo& info);
51 
59  AudioDecoderSimple(const SoundInfo& info);
60 
62 
63  // See dox in AudioDecoder.h
64  std::uint8_t* decode(const std::uint8_t* input, std::uint32_t inputSize, std::uint32_t& outputSize, std::uint32_t& decodedBytes);
65 
66 private:
67 
68  // throws MediaException on failure
69  void setup(const AudioInfo& info);
70 
71  // throws MediaException on failure
72  void setup(const SoundInfo& info);
73 
74  // codec
75  audioCodecType _codec;
76 
77  // samplerate
78  std::uint16_t _sampleRate;
79 
80  // sampleCount
81  std::uint32_t _sampleCount;
82 
83  // stereo
84  bool _stereo;
85 
86  // samplesize: 8 or 16 bit
87  bool _is16bit;
88 
89 
90  //
91 };
92 
93 } // gnash.media namespace
94 } // gnash namespace
95 
96 #endif // __AUDIODECODERSIMPLE_H__
97 
Class containing information about an embedded sound definition.
Definition: SoundInfo.h:34
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
Information about an audio stream.
Definition: MediaParser.h:236
audioCodecType
Audio codec ids as defined in flash.
Definition: MediaParser.h:122
Audio decoding using "simple" internal decoders.
Definition: AudioDecoderSimple.h:39
Audio decoding base class.
Definition: AudioDecoder.h:36