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;
31 enum _GstVaapiChromaType {
32 GST_VAAPI_CHROMA_TYPE_YUV420 = 1,
33 GST_VAAPI_CHROMA_TYPE_YUV422,
34 GST_VAAPI_CHROMA_TYPE_YUV444
37 #define GST_VAAPI_TYPE_SURFACE \
38 (gst_vaapi_surface_get_type())
40 #define GST_VAAPI_SURFACE(obj) \
41 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
42 GST_VAAPI_TYPE_SURFACE, \
45 #define GST_VAAPI_SURFACE_CLASS(klass) \
46 (G_TYPE_CHECK_CLASS_CAST((klass), \
47 GST_VAAPI_TYPE_SURFACE, \
48 GstVaapiSurfaceClass))
50 #define GST_VAAPI_IS_SURFACE(obj) \
51 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_SURFACE))
53 #define GST_VAAPI_IS_SURFACE_CLASS(klass) \
54 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_SURFACE))
56 #define GST_VAAPI_SURFACE_GET_CLASS(obj) \
57 (G_TYPE_INSTANCE_GET_CLASS((obj), \
58 GST_VAAPI_TYPE_SURFACE, \
59 GstVaapiSurfaceClass))
61 typedef struct _GstVaapiSurface GstVaapiSurface;
62 typedef struct _GstVaapiSurfacePrivate GstVaapiSurfacePrivate;
63 typedef struct _GstVaapiSurfaceClass GstVaapiSurfaceClass;
65 struct _GstVaapiSurface {
67 GObject parent_instance;
69 GstVaapiSurfacePrivate *priv;
72 struct _GstVaapiSurfaceClass {
74 GObjectClass parent_class;
78 gst_vaapi_surface_get_type(void);
81 gst_vaapi_surface_new(
82 GstVaapiDisplay *display,
83 GstVaapiChromaType chroma_type,
89 gst_vaapi_surface_get_id(GstVaapiSurface *surface);
92 gst_vaapi_surface_get_display(GstVaapiSurface *surface);
95 gst_vaapi_surface_get_chroma_type(GstVaapiSurface *surface);
98 gst_vaapi_surface_get_width(GstVaapiSurface *surface);
101 gst_vaapi_surface_get_height(GstVaapiSurface *surface);
104 gst_vaapi_surface_get_size(
105 GstVaapiSurface *surface,
111 gst_vaapi_surface_derive_image(GstVaapiSurface *surface);
114 gst_vaapi_surface_get_image(GstVaapiSurface *surface, GstVaapiImage *image);
117 gst_vaapi_surface_put_image(GstVaapiSurface *surface, GstVaapiImage *image);
120 gst_vaapi_surface_sync(GstVaapiSurface *surface);
124 #endif /* GST_VAAPI_SURFACE_H */