2 * gstvaapiwindow.h - VA window 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_WINDOW_H
22 #define GST_VAAPI_WINDOW_H
24 #include <gst/video/gstvideosink.h>
25 #include <gst/vaapi/gstvaapidisplay.h>
26 #include <gst/vaapi/gstvaapisurface.h>
31 GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD = 1 << 0,
32 GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD = 1 << 1,
33 GST_VAAPI_PICTURE_STRUCTURE_FRAME =
35 GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD |
36 GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD
38 GST_VAAPI_COLOR_STANDARD_ITUR_BT_601 = 1 << 2,
39 GST_VAAPI_COLOR_STANDARD_ITUR_BT_709 = 1 << 3,
42 #define GST_VAAPI_TYPE_WINDOW \
43 (gst_vaapi_window_get_type())
45 #define GST_VAAPI_WINDOW(obj) \
46 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
47 GST_VAAPI_TYPE_WINDOW, \
50 #define GST_VAAPI_WINDOW_CLASS(klass) \
51 (G_TYPE_CHECK_CLASS_CAST((klass), \
52 GST_VAAPI_TYPE_WINDOW, \
55 #define GST_VAAPI_IS_WINDOW(obj) \
56 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_WINDOW))
58 #define GST_VAAPI_IS_WINDOW_CLASS(klass) \
59 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_WINDOW))
61 #define GST_VAAPI_WINDOW_GET_CLASS(obj) \
62 (G_TYPE_INSTANCE_GET_CLASS((obj), \
63 GST_VAAPI_TYPE_WINDOW, \
66 typedef struct _GstVaapiWindow GstVaapiWindow;
67 typedef struct _GstVaapiWindowPrivate GstVaapiWindowPrivate;
68 typedef struct _GstVaapiWindowClass GstVaapiWindowClass;
73 * Base class for system-dependent windows.
75 struct _GstVaapiWindow {
77 GObject parent_instance;
80 GstVaapiWindowPrivate *priv;
84 * GstVaapiWindowClass:
85 * @create: virtual function to create a window with width and height
86 * @destroy: virtual function to destroy a window
87 * @show: virtual function to show (map) a window
88 * @hide: virtual function to hide (unmap) a window
89 * @resize: virtual function to resize a window
90 * @render: virtual function to render a #GstVaapiSurface into a window
92 * Base class for system-dependent windows.
94 struct _GstVaapiWindowClass {
96 GObjectClass parent_class;
98 gboolean (*create) (GstVaapiWindow *window, guint *width, guint *height);
99 void (*destroy)(GstVaapiWindow *window);
100 gboolean (*show) (GstVaapiWindow *window);
101 gboolean (*hide) (GstVaapiWindow *window);
102 gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
103 gboolean (*render) (GstVaapiWindow *window,
104 GstVaapiSurface *surface,
105 const GstVideoRectangle *src_rect,
106 const GstVideoRectangle *dst_rect,
111 gst_vaapi_window_get_type(void);
114 gst_vaapi_window_show(GstVaapiWindow *window);
117 gst_vaapi_window_hide(GstVaapiWindow *window);
120 gst_vaapi_window_get_width(GstVaapiWindow *window);
123 gst_vaapi_window_get_height(GstVaapiWindow *window);
126 gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight);
129 gst_vaapi_window_set_width(GstVaapiWindow *window, guint width);
132 gst_vaapi_window_set_height(GstVaapiWindow *window, guint height);
135 gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height);
138 gst_vaapi_window_put_surface(
139 GstVaapiWindow *window,
140 GstVaapiSurface *surface,
141 const GstVideoRectangle *src_rect,
142 const GstVideoRectangle *dst_rect,
148 #endif /* GST_VAAPI_WINDOW_H */