1 // VaapiImage.h: VA image abstraction
3 // Copyright (C) 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
20 #ifndef GNASH_VAAPIIMAGE_H
21 #define GNASH_VAAPIIMAGE_H
23 #include <boost/scoped_array.hpp>
27 #include "vaapi_common.h"
28 #include "VaapiImageFormat.h"
30 // Forward declarations
35 // Forward declarations
38 class SwsContextWrapper
;
40 /// VA image abstraction
41 class DSOEXPORT VaapiImage
43 VaapiImageFormat _format
;
45 boost::uint8_t * _image_data
;
48 bool create(unsigned int width
, unsigned int height
);
54 VaapiImage(unsigned int width
,
56 VaapiImageFormat format
= VAAPI_IMAGE_RGB32
);
60 VAImageID
get() const { return _image
.image_id
; }
63 VaapiImageFormat
format() const { return _format
; }
66 unsigned int width() const { return _image
.width
; }
69 unsigned int height() const { return _image
.height
; }
71 /// Check whether the VA image is mapped
72 bool isMapped() const { return _image_data
!= NULL
; }
80 /// Get number of planes
81 unsigned int getPlaneCount() const { return _image
.num_planes
; }
83 /// Get pixels for the specified plane
84 boost::uint8_t *getPlane(int plane
) const;
86 /// Get scanline pitch for the specified plane
87 unsigned int getPitch(int plane
) const;
92 #endif // GNASH_VAAPIIMAGE_H
96 // indent-tabs-mode: nil