2 * gstvaapiimage.h - VA image abstraction
4 * gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef GST_VAAPI_IMAGE_H
22 #define GST_VAAPI_IMAGE_H
24 #include <gst/gstbuffer.h>
25 #include <gst/vaapi/gstvaapiobject.h>
26 #include <gst/vaapi/gstvaapidisplay.h>
27 #include <gst/vaapi/gstvaapiimageformat.h>
31 #define GST_VAAPI_TYPE_IMAGE \
32 (gst_vaapi_image_get_type())
34 #define GST_VAAPI_IMAGE(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
36 GST_VAAPI_TYPE_IMAGE, \
39 #define GST_VAAPI_IMAGE_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass), \
41 GST_VAAPI_TYPE_IMAGE, \
44 #define GST_VAAPI_IS_IMAGE(obj) \
45 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_IMAGE))
47 #define GST_VAAPI_IS_IMAGE_CLASS(klass) \
48 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_IMAGE))
50 #define GST_VAAPI_IMAGE_GET_CLASS(obj) \
51 (G_TYPE_INSTANCE_GET_CLASS((obj), \
52 GST_VAAPI_TYPE_IMAGE, \
56 * GST_VAAPI_IMAGE_FORMAT:
57 * @image: a #GstVaapiImage
59 * Macro that evaluates to the #GstVaapiImageFormat of @image.
61 #define GST_VAAPI_IMAGE_FORMAT(image) gst_vaapi_image_get_format(image)
64 * GST_VAAPI_IMAGE_WIDTH:
65 * @image: a #GstVaapiImage
67 * Macro that evaluates to the width of @image.
69 #define GST_VAAPI_IMAGE_WIDTH(image) gst_vaapi_image_get_width(image)
72 * GST_VAAPI_IMAGE_HEIGHT:
73 * @image: a #GstVaapiImage
75 * Macro that evaluates to the height of @image.
77 #define GST_VAAPI_IMAGE_HEIGHT(image) gst_vaapi_image_get_height(image)
79 typedef struct _GstVaapiImage GstVaapiImage;
80 typedef struct _GstVaapiImagePrivate GstVaapiImagePrivate;
81 typedef struct _GstVaapiImageClass GstVaapiImageClass;
88 struct _GstVaapiImage {
90 GstVaapiObject parent_instance;
92 GstVaapiImagePrivate *priv;
98 * A VA image wrapper class
100 struct _GstVaapiImageClass {
102 GstVaapiObjectClass parent_class;
106 gst_vaapi_image_get_type(void);
110 GstVaapiDisplay *display,
111 GstVaapiImageFormat format,
117 gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image);
120 gst_vaapi_image_get_id(GstVaapiImage *image);
123 gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image);
126 gst_vaapi_image_get_format(GstVaapiImage *image);
129 gst_vaapi_image_get_width(GstVaapiImage *image);
132 gst_vaapi_image_get_height(GstVaapiImage *image);
135 gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight);
138 gst_vaapi_image_is_linear(GstVaapiImage *image);
141 gst_vaapi_image_is_mapped(GstVaapiImage *image);
144 gst_vaapi_image_map(GstVaapiImage *image);
147 gst_vaapi_image_unmap(GstVaapiImage *image);
150 gst_vaapi_image_get_plane_count(GstVaapiImage *image);
153 gst_vaapi_image_get_plane(GstVaapiImage *image, guint plane);
156 gst_vaapi_image_get_pitch(GstVaapiImage *image, guint plane);
159 gst_vaapi_image_get_data_size(GstVaapiImage *image);
162 gst_vaapi_image_update_from_buffer(GstVaapiImage *image, GstBuffer *buffer);
166 #endif /* GST_VAAPI_IMAGE_H */