update the copyright date.
[gnash.git] / libmedia / AudioDecoder.h
blob8c34ff86f7885da0b7cc7025bb05e9bca4705182
1 // AudioDecoder.h: Audio decoding base class.
2 //
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011 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 /// @return a pointer to the decoded data, or NULL if decoding fails.
60 /// The caller owns the decoded data, which was allocated with new [].
61 ///
62 /// @todo return a SimpleBuffer by auto_ptr
63 ///
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
70 /// @param input
71 /// The audio data
72 ///
73 /// @param outputSize
74 /// The output size of the video data, is passed by reference.
75 ///
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 [].
78 ///
79 /// @todo return a SimpleBuffer by auto_ptr
80 ///
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&,
88 boost::uint32_t&)
90 return 0;
93 inline boost::uint8_t*
94 AudioDecoder::decode(const EncodedAudioFrame&, boost::uint32_t&)
96 return 0;
99 } // gnash.media namespace
100 } // gnash namespace
102 #endif