1 // AudioDecoder.h: Audio decoding base class.
3 // Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
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.
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
27 class EncodedAudioFrame
;
34 /// Audio decoding base class.
41 // virtual classes need a virtual destructor !
42 virtual ~AudioDecoder() {}
44 /// Decodes a frame and returns a pointer to the data
50 /// The size of the video data
53 /// The output size of the video data, is passed by reference.
55 /// @param decodedData
56 /// The amount of bytes that has been decoded when decoding is done,
57 /// is passed by reference.
60 /// Should we parse the audio? Needed for embedded MP3 sounds.
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 [].
65 /// @todo return a SimpleBuffer by auto_ptr
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
77 /// The output size of the video data, is passed by reference.
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 [].
82 /// @todo return a SimpleBuffer by auto_ptr
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)
96 inline boost::uint8_t*
97 AudioDecoder::decode(const EncodedAudioFrame
&, boost::uint32_t&)
102 } // gnash.media namespace