1 // AudioDecoder.h: Audio decoding base class.
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011 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.
59 /// @return a pointer to the decoded data, or NULL if decoding fails.
60 /// The caller owns the decoded data, which was allocated with new [].
62 /// @todo return a SimpleBuffer by auto_ptr
64 virtual boost::uint8_t* decode(const boost::uint8_t* input
,
65 boost::uint32_t inputSize
, boost::uint32_t& outputSize
,
66 boost::uint32_t& decodedData
);
68 /// Decodes an EncodedAudioFrame and returns a pointer to the decoded data
74 /// The output size of the video data, is passed by reference.
76 /// @return a pointer to the decoded data, or NULL if decoding fails.
77 /// The caller owns the decoded data, which was allocated with new [].
79 /// @todo return a SimpleBuffer by auto_ptr
81 virtual boost::uint8_t* decode(const EncodedAudioFrame
& input
,
82 boost::uint32_t& outputSize
);
86 inline boost::uint8_t*
87 AudioDecoder::decode(const boost::uint8_t*, boost::uint32_t, boost::uint32_t&,
93 inline boost::uint8_t*
94 AudioDecoder::decode(const EncodedAudioFrame
&, boost::uint32_t&)
99 } // gnash.media namespace