don't add (LIBLTDL) to LDFLAGS, libltdl is part of libgnashbase.
[gnash.git] / libmedia / VideoDecoder.h
blob68ee6df872e18b39c98f8f3e0862e04787b5aa03
1 // VideoDecoder.h: Video 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
20 #ifndef GNASH_VIDEODECODER_H
21 #define GNASH_VIDEODECODER_H
23 #include "GnashImage.h"
25 #include <boost/noncopyable.hpp>
27 // Forward declarations
28 namespace gnash {
29 namespace media {
30 class EncodedVideoFrame;
34 namespace gnash {
35 namespace media {
37 /// Abstract base class for embedded video decoders.
39 /// This very simple design allows, but does not require,
40 /// the use of threads in an implementation. A user of this class push a frame
41 /// into the decoder and can subsequently pop a decoded frame. Since the pop()
42 /// call may block, it is advisable to first call peek() to see if there is a
43 /// frame ready to be popped.
44 ///
45 class VideoDecoder : public boost::noncopyable {
47 public:
48 virtual ~VideoDecoder()
52 /// Push an encoded video frame into the decoder
54 /// @param buffer the video frame to decode
55 ///
56 virtual void push(const EncodedVideoFrame& buffer) = 0;
58 /// Pop a decoded frame from the decoder. THIS METHOD MAY BLOCK.
60 /// @return The decoded video frame, or a NULL-containing auto_ptr if an
61 /// error occurred.
62 virtual std::auto_ptr<image::GnashImage> pop() = 0;
64 /// \brief
65 /// Check whether a decoded frame is ready to be popped.
67 /// This method will never block.
68 ///
69 /// @return true if there is a frame ready to be popped.
70 ///
71 virtual bool peek() = 0;
73 /// Get the width in pixels of the Video
75 /// @return The width of a video frame, or 0 until this is known.
76 /// This is used ultimately for the AS Video.width property.
77 virtual int width() const = 0;
79 /// Get the height in pixels of the Video
81 /// @return The height of a video frame, or 0 until this is known.
82 /// This is used ultimately for the AS Video.height property.
83 virtual int height() const = 0;
88 } // gnash.media namespace
89 } // gnash namespace
91 #endif // __VIDEODECODER_H__