Fix test for bug #32625
[gnash.git] / libmedia / AudioDecoder.h
blobe5ce6773adc01e5d15becee68d7c0d21538bc706
1 // AudioDecoder.h: Audio decoding base class.
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010 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 #ifndef GNASH_AUDIODECODER_H
20 #define GNASH_AUDIODECODER_H
22 #include <boost/cstdint.hpp> // for C99 int types
24 // Forward declarations
25 namespace gnash {
26 namespace media {
27 class EncodedAudioFrame;
31 namespace gnash {
32 namespace media {
34 /// Audio decoding base class.
35 class AudioDecoder {
37 public:
39 AudioDecoder() {}
41 // virtual classes need a virtual destructor !
42 virtual ~AudioDecoder() {}
44 /// Decodes a frame and returns a pointer to the data
46 /// @param input
47 /// The audio data
48 ///
49 /// @param inputSize
50 /// The size of the video data
51 ///
52 /// @param outputSize
53 /// The output size of the video data, is passed by reference.
54 ///
55 /// @param decodedData
56 /// The amount of bytes that has been decoded when decoding is done,
57 /// is passed by reference.
58 ///
59 /// @param parse
60 /// Should we parse the audio? Needed for embedded MP3 sounds.
61 ///
62 /// @return a pointer to the decoded data, or NULL if decoding fails.
63 /// The caller owns the decoded data, which was allocated with new [].
64 ///
65 /// @todo return a SimpleBuffer by auto_ptr
66 ///
67 virtual boost::uint8_t* decode(const boost::uint8_t* input,
68 boost::uint32_t inputSize, boost::uint32_t& outputSize,
69 boost::uint32_t& decodedData, bool parse);
71 /// Decodes an EncodedAudioFrame and returns a pointer to the decoded data
73 /// @param input
74 /// The audio data
75 ///
76 /// @param outputSize
77 /// The output size of the video data, is passed by reference.
78 ///
79 /// @return a pointer to the decoded data, or NULL if decoding fails.
80 /// The caller owns the decoded data, which was allocated with new [].
81 ///
82 /// @todo return a SimpleBuffer by auto_ptr
83 ///
84 virtual boost::uint8_t* decode(const EncodedAudioFrame& input,
85 boost::uint32_t& outputSize);
89 inline boost::uint8_t*
90 AudioDecoder::decode(const boost::uint8_t*, boost::uint32_t, boost::uint32_t&,
91 boost::uint32_t&, bool)
93 return 0;
96 inline boost::uint8_t*
97 AudioDecoder::decode(const EncodedAudioFrame&, boost::uint32_t&)
99 return 0;
102 } // gnash.media namespace
103 } // gnash namespace
105 #endif