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>
30 #define GST_VAAPI_TYPE_WINDOW \
31 (gst_vaapi_window_get_type())
33 #define GST_VAAPI_WINDOW(obj) \
34 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
35 GST_VAAPI_TYPE_WINDOW, \
38 #define GST_VAAPI_WINDOW_CLASS(klass) \
39 (G_TYPE_CHECK_CLASS_CAST((klass), \
40 GST_VAAPI_TYPE_WINDOW, \
43 #define GST_VAAPI_IS_WINDOW(obj) \
44 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_WINDOW))
46 #define GST_VAAPI_IS_WINDOW_CLASS(klass) \
47 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_WINDOW))
49 #define GST_VAAPI_WINDOW_GET_CLASS(obj) \
50 (G_TYPE_INSTANCE_GET_CLASS((obj), \
51 GST_VAAPI_TYPE_WINDOW, \
54 typedef struct _GstVaapiWindow GstVaapiWindow;
55 typedef struct _GstVaapiWindowPrivate GstVaapiWindowPrivate;
56 typedef struct _GstVaapiWindowClass GstVaapiWindowClass;
61 * Base class for system-dependent windows.
63 struct _GstVaapiWindow {
65 GObject parent_instance;
67 GstVaapiWindowPrivate *priv;
71 * GstVaapiWindowClass:
72 * @create: virtual function to create a window with width and height
73 * @destroy: virtual function to destroy a window
74 * @show: virtual function to show (map) a window
75 * @hide: virtual function to hide (unmap) a window
76 * @resize: virtual function to resize a window
77 * @render: virtual function to render a #GstVaapiSurface into a window
79 * Base class for system-dependent windows.
81 struct _GstVaapiWindowClass {
83 GObjectClass parent_class;
86 gboolean (*create) (GstVaapiWindow *window, guint *width, guint *height);
87 void (*destroy)(GstVaapiWindow *window);
88 gboolean (*show) (GstVaapiWindow *window);
89 gboolean (*hide) (GstVaapiWindow *window);
90 gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
91 gboolean (*render) (GstVaapiWindow *window,
92 GstVaapiSurface *surface,
93 const GstVideoRectangle *src_rect,
94 const GstVideoRectangle *dst_rect,
99 gst_vaapi_window_get_type(void);
102 gst_vaapi_window_show(GstVaapiWindow *window);
105 gst_vaapi_window_hide(GstVaapiWindow *window);
108 gst_vaapi_window_get_width(GstVaapiWindow *window);
111 gst_vaapi_window_get_height(GstVaapiWindow *window);
114 gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight);
117 gst_vaapi_window_set_width(GstVaapiWindow *window, guint width);
120 gst_vaapi_window_set_height(GstVaapiWindow *window, guint height);
123 gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height);
126 gst_vaapi_window_put_surface(
127 GstVaapiWindow *window,
128 GstVaapiSurface *surface,
129 const GstVideoRectangle *src_rect,
130 const GstVideoRectangle *dst_rect,
136 #endif /* GST_VAAPI_WINDOW_H */