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 * @set_fullscreen: virtual function to change window fullscreen state
77 * @resize: virtual function to resize a window
78 * @render: virtual function to render a #GstVaapiSurface into a window
80 * Base class for system-dependent windows.
82 struct _GstVaapiWindowClass {
84 GObjectClass parent_class;
87 gboolean (*create) (GstVaapiWindow *window, guint *width, guint *height);
88 void (*destroy)(GstVaapiWindow *window);
89 gboolean (*show) (GstVaapiWindow *window);
90 gboolean (*hide) (GstVaapiWindow *window);
91 gboolean (*set_fullscreen)(GstVaapiWindow *window, gboolean fullscreen);
92 gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
93 gboolean (*render) (GstVaapiWindow *window,
94 GstVaapiSurface *surface,
95 const GstVideoRectangle *src_rect,
96 const GstVideoRectangle *dst_rect,
101 gst_vaapi_window_get_type(void);
104 gst_vaapi_window_show(GstVaapiWindow *window);
107 gst_vaapi_window_hide(GstVaapiWindow *window);
110 gst_vaapi_window_set_fullscreen(GstVaapiWindow *window, gboolean fullscreen);
113 gst_vaapi_window_get_width(GstVaapiWindow *window);
116 gst_vaapi_window_get_height(GstVaapiWindow *window);
119 gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight);
122 gst_vaapi_window_set_width(GstVaapiWindow *window, guint width);
125 gst_vaapi_window_set_height(GstVaapiWindow *window, guint height);
128 gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height);
131 gst_vaapi_window_put_surface(
132 GstVaapiWindow *window,
133 GstVaapiSurface *surface,
134 const GstVideoRectangle *src_rect,
135 const GstVideoRectangle *dst_rect,
141 #endif /* GST_VAAPI_WINDOW_H */