update copyright date
[gnash.git] / libbase / GnashVaapiImage.h
blob2e64f6be5e1b880113e4bcfeb9281862f7ea4867
1 // GnashVaapiImage.h: GnashImage class used with VA API
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.
14 //
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_GNASHVAAPIIMAGE_H
21 #define GNASH_GNASHVAAPIIMAGE_H
23 #include <boost/shared_ptr.hpp>
25 #include "GnashImage.h"
26 #include "dsodefs.h"
28 namespace gnash {
30 // Forward declarations
31 class VaapiSurface;
32 class VaapiSurfaceProxy;
34 /// GnashImage implementation using a VA surface
35 class DSOEXPORT GnashVaapiImage : public image::GnashImage
37 boost::shared_ptr<VaapiSurface> _surface;
38 boost::uint64_t _creation_time;
40 /// Transfer (and convert) VA surface to CPU image data
41 bool transfer();
43 public:
44 GnashVaapiImage(boost::shared_ptr<VaapiSurface> surface,
45 image::ImageType type);
46 GnashVaapiImage(const GnashVaapiImage& o);
47 ~GnashVaapiImage();
49 virtual void update(boost::shared_ptr<VaapiSurface> surface);
50 virtual void update(boost::uint8_t* data);
51 virtual void update(const image::GnashImage& from);
53 /// Get access to the underlying surface
55 /// @return A pointer to the VA surface.
56 boost::shared_ptr<VaapiSurface> surface() const
57 { return _surface; }
59 /// Get access to the underlying data
61 /// NOTE: This function shall not be used
63 /// @return NULL.
64 virtual iterator begin();
66 /// Get read-only access to the underlying data
68 /// @return A read-only pointer to the raw image data.
69 virtual const_iterator begin() const;
72 } // gnash namespace
74 #endif // GNASH_GNASHVAAPIIMAGE_H
76 // local Variables:
77 // mode: C++
78 // indent-tabs-mode: t
79 // End: