2 * gstvaapiimage.h - VA image abstraction
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
5 * Author: Gwenole Beauchesne <gwenole.beauchesne@splitted-desktop.com>
6 * Copyright (C) 2011-2013 Intel Corporation
7 * Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free
21 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA
25 #ifndef GST_VAAPI_IMAGE_H
26 #define GST_VAAPI_IMAGE_H
28 #include <gst/gstbuffer.h>
29 #include <gst/vaapi/gstvaapidisplay.h>
30 #include <gst/vaapi/video-format.h>
34 #define GST_VAAPI_IMAGE(obj) \
35 ((GstVaapiImage *)(obj))
38 * GST_VAAPI_IMAGE_FORMAT:
39 * @image: a #GstVaapiImage
41 * Macro that evaluates to the #GstVideoFormat of @image.
43 #define GST_VAAPI_IMAGE_FORMAT(image) gst_vaapi_image_get_format(image)
46 * GST_VAAPI_IMAGE_WIDTH:
47 * @image: a #GstVaapiImage
49 * Macro that evaluates to the width of @image.
51 #define GST_VAAPI_IMAGE_WIDTH(image) gst_vaapi_image_get_width(image)
54 * GST_VAAPI_IMAGE_HEIGHT:
55 * @image: a #GstVaapiImage
57 * Macro that evaluates to the height of @image.
59 #define GST_VAAPI_IMAGE_HEIGHT(image) gst_vaapi_image_get_height(image)
62 * GST_VAAPI_IMAGE_DISPLAY:
63 * @image: a #GstVaapiImage
65 * Macro that evaluates to the display of @image
67 #define GST_VAAPI_IMAGE_DISPLAY(image) gst_vaapi_image_get_display(image)
71 * @image: a #GstVaapiImage
73 * Macro that evaluates to the ID of @image
75 #define GST_VAAPI_IMAGE_ID(image) gst_vaapi_image_get_id(image)
77 #define GST_TYPE_VAAPI_IMAGE (gst_vaapi_image_get_type ())
79 typedef struct _GstVaapiImage GstVaapiImage;
82 gst_vaapi_image_get_type (void) G_GNUC_CONST;
85 gst_vaapi_image_get_display (GstVaapiImage * image);
89 GstVaapiDisplay *display,
90 GstVideoFormat format,
96 gst_vaapi_image_new_with_image(GstVaapiDisplay *display, VAImage *va_image);
99 * gst_vaapi_image_unref: (skip)
100 * @image: (transfer full): a #GstVaapiImage.
102 * Decreases the refcount of the image. If the refcount reaches 0, the
103 * image will be freed.
106 gst_vaapi_image_unref (GstVaapiImage * image)
108 gst_mini_object_unref (GST_MINI_OBJECT_CAST (image));
112 gst_vaapi_image_get_id(GstVaapiImage *image);
115 gst_vaapi_image_get_image(GstVaapiImage *image, VAImage *va_image);
118 gst_vaapi_image_get_format(GstVaapiImage *image);
121 gst_vaapi_image_get_width(GstVaapiImage *image);
124 gst_vaapi_image_get_height(GstVaapiImage *image);
127 gst_vaapi_image_get_size(GstVaapiImage *image, guint *pwidth, guint *pheight);
130 gst_vaapi_image_is_linear(GstVaapiImage *image);
133 gst_vaapi_image_is_mapped(GstVaapiImage *image);
136 gst_vaapi_image_map(GstVaapiImage *image);
139 gst_vaapi_image_unmap(GstVaapiImage *image);
142 gst_vaapi_image_get_plane_count(GstVaapiImage *image);
145 gst_vaapi_image_get_plane(GstVaapiImage *image, guint plane);
148 gst_vaapi_image_get_pitch(GstVaapiImage *image, guint plane);
151 gst_vaapi_image_get_data_size(GstVaapiImage *image);
154 gst_vaapi_image_get_buffer(
155 GstVaapiImage *image,
157 GstVaapiRectangle *rect
161 gst_vaapi_image_update_from_buffer(
162 GstVaapiImage *image,
164 GstVaapiRectangle *rect
168 gst_vaapi_image_copy(GstVaapiImage *dst_image, GstVaapiImage *src_image);
170 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiImage, gst_vaapi_image_unref)
174 #endif /* GST_VAAPI_IMAGE_H */