2 * gstvaapisurface.h - VA surface 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_SURFACE_H
22 #define GST_VAAPI_SURFACE_H
24 #include <gst/vaapi/gstvaapiimage.h>
25 #include <gst/vaapi/gstvaapidisplay.h>
29 typedef enum _GstVaapiChromaType GstVaapiChromaType;
30 typedef enum _GstVaapiSurfaceRenderFlags GstVaapiSurfaceRenderFlags;
34 * @GST_VAAPI_CHROMA_TYPE_YUV420: 4:2:0 chroma format
35 * @GST_VAAPI_CHROMA_TYPE_YUV422: 4:2:2 chroma format
36 * @GST_VAAPI_CHROMA_TYPE_YUV444: 4:4:4 chroma format
38 * The set of all chroma types for #GstVaapiSurface.
40 enum _GstVaapiChromaType {
41 GST_VAAPI_CHROMA_TYPE_YUV420 = 1,
42 GST_VAAPI_CHROMA_TYPE_YUV422,
43 GST_VAAPI_CHROMA_TYPE_YUV444
47 * GstVaapiSurfaceRenderFlags
48 * @GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD:
49 * selects the top field of the surface
50 * @GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD:
51 * selects the bottom field of the surface
52 * @GST_VAAPI_PICTURE_STRUCTURE_FRAME:
53 * selects the entire surface
54 * @GST_VAAPI_COLOR_STANDARD_ITUR_BT_601:
55 * uses ITU-R BT.601 standard for color space conversion
56 * @GST_VAAPI_COLOR_STANDARD_ITUR_BT_709:
57 * uses ITU-R BT.709 standard for color space conversion
59 * The set of all render flags for gst_vaapi_window_put_surface().
61 enum _GstVaapiSurfaceRenderFlags {
62 GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD = 1 << 0,
63 GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD = 1 << 1,
64 GST_VAAPI_PICTURE_STRUCTURE_FRAME =
66 GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD |
67 GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD
69 GST_VAAPI_COLOR_STANDARD_ITUR_BT_601 = 1 << 2,
70 GST_VAAPI_COLOR_STANDARD_ITUR_BT_709 = 1 << 3,
73 #define GST_VAAPI_TYPE_SURFACE \
74 (gst_vaapi_surface_get_type())
76 #define GST_VAAPI_SURFACE(obj) \
77 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
78 GST_VAAPI_TYPE_SURFACE, \
81 #define GST_VAAPI_SURFACE_CLASS(klass) \
82 (G_TYPE_CHECK_CLASS_CAST((klass), \
83 GST_VAAPI_TYPE_SURFACE, \
84 GstVaapiSurfaceClass))
86 #define GST_VAAPI_IS_SURFACE(obj) \
87 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_SURFACE))
89 #define GST_VAAPI_IS_SURFACE_CLASS(klass) \
90 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_SURFACE))
92 #define GST_VAAPI_SURFACE_GET_CLASS(obj) \
93 (G_TYPE_INSTANCE_GET_CLASS((obj), \
94 GST_VAAPI_TYPE_SURFACE, \
95 GstVaapiSurfaceClass))
97 typedef struct _GstVaapiSurface GstVaapiSurface;
98 typedef struct _GstVaapiSurfacePrivate GstVaapiSurfacePrivate;
99 typedef struct _GstVaapiSurfaceClass GstVaapiSurfaceClass;
104 * A VA surface wrapper.
106 struct _GstVaapiSurface {
108 GObject parent_instance;
111 GstVaapiSurfacePrivate *priv;
115 * GstVaapiSurfaceClass:
117 * A VA surface wrapper class.
119 struct _GstVaapiSurfaceClass {
121 GObjectClass parent_class;
125 gst_vaapi_surface_get_type(void);
128 gst_vaapi_surface_new(
129 GstVaapiDisplay *display,
130 GstVaapiChromaType chroma_type,
136 gst_vaapi_surface_get_id(GstVaapiSurface *surface);
139 gst_vaapi_surface_get_display(GstVaapiSurface *surface);
142 gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface);
145 gst_vaapi_surface_get_width(GstVaapiSurface *surface);
148 gst_vaapi_surface_get_height(GstVaapiSurface *surface);
151 gst_vaapi_surface_get_size(
152 GstVaapiSurface *surface,
158 gst_vaapi_surface_derive_image(GstVaapiSurface *surface);
161 gst_vaapi_surface_get_image(GstVaapiSurface *surface, GstVaapiImage *image);
164 gst_vaapi_surface_put_image(GstVaapiSurface *surface, GstVaapiImage *image);
167 gst_vaapi_surface_sync(GstVaapiSurface *surface);
171 #endif /* GST_VAAPI_SURFACE_H */