2 * gstvaapiwindow.h - VA window abstraction
4 * Copyright (C) 2010-2011 Splitted-Desktop Systems
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public License
8 * as published by the Free Software Foundation; either version 2.1
9 * of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free
18 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301 USA
22 #ifndef GST_VAAPI_WINDOW_H
23 #define GST_VAAPI_WINDOW_H
25 #include <gst/video/gstvideosink.h>
26 #include <gst/vaapi/gstvaapitypes.h>
27 #include <gst/vaapi/gstvaapiobject.h>
28 #include <gst/vaapi/gstvaapidisplay.h>
29 #include <gst/vaapi/gstvaapisurface.h>
33 #define GST_VAAPI_TYPE_WINDOW \
34 (gst_vaapi_window_get_type())
36 #define GST_VAAPI_WINDOW(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST((obj), \
38 GST_VAAPI_TYPE_WINDOW, \
41 #define GST_VAAPI_WINDOW_CLASS(klass) \
42 (G_TYPE_CHECK_CLASS_CAST((klass), \
43 GST_VAAPI_TYPE_WINDOW, \
46 #define GST_VAAPI_IS_WINDOW(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_WINDOW))
49 #define GST_VAAPI_IS_WINDOW_CLASS(klass) \
50 (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_WINDOW))
52 #define GST_VAAPI_WINDOW_GET_CLASS(obj) \
53 (G_TYPE_INSTANCE_GET_CLASS((obj), \
54 GST_VAAPI_TYPE_WINDOW, \
57 typedef struct _GstVaapiWindow GstVaapiWindow;
58 typedef struct _GstVaapiWindowPrivate GstVaapiWindowPrivate;
59 typedef struct _GstVaapiWindowClass GstVaapiWindowClass;
64 * Base class for system-dependent windows.
66 struct _GstVaapiWindow {
68 GstVaapiObject parent_instance;
70 GstVaapiWindowPrivate *priv;
74 * GstVaapiWindowClass:
75 * @create: virtual function to create a window with width and height
76 * @destroy: virtual function to destroy a window
77 * @show: virtual function to show (map) a window
78 * @hide: virtual function to hide (unmap) a window
79 * @set_fullscreen: virtual function to change window fullscreen state
80 * @resize: virtual function to resize a window
81 * @render: virtual function to render a #GstVaapiSurface into a window
83 * Base class for system-dependent windows.
85 struct _GstVaapiWindowClass {
87 GstVaapiObjectClass parent_class;
90 gboolean (*create) (GstVaapiWindow *window, guint *width, guint *height);
91 void (*destroy)(GstVaapiWindow *window);
92 gboolean (*show) (GstVaapiWindow *window);
93 gboolean (*hide) (GstVaapiWindow *window);
94 gboolean (*get_geometry) (GstVaapiWindow *window,
96 guint *pwidth, guint *pheight);
97 gboolean (*set_fullscreen)(GstVaapiWindow *window, gboolean fullscreen);
98 gboolean (*resize) (GstVaapiWindow *window, guint width, guint height);
99 gboolean (*render) (GstVaapiWindow *window,
100 GstVaapiSurface *surface,
101 const GstVaapiRectangle *src_rect,
102 const GstVaapiRectangle *dst_rect,
107 gst_vaapi_window_get_type(void) G_GNUC_CONST;
110 gst_vaapi_window_get_display(GstVaapiWindow *window);
113 gst_vaapi_window_show(GstVaapiWindow *window);
116 gst_vaapi_window_hide(GstVaapiWindow *window);
119 gst_vaapi_window_get_fullscreen(GstVaapiWindow *window);
122 gst_vaapi_window_set_fullscreen(GstVaapiWindow *window, gboolean fullscreen);
125 gst_vaapi_window_get_width(GstVaapiWindow *window);
128 gst_vaapi_window_get_height(GstVaapiWindow *window);
131 gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight);
134 gst_vaapi_window_set_width(GstVaapiWindow *window, guint width);
137 gst_vaapi_window_set_height(GstVaapiWindow *window, guint height);
140 gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height);
143 gst_vaapi_window_put_surface(
144 GstVaapiWindow *window,
145 GstVaapiSurface *surface,
146 const GstVaapiRectangle *src_rect,
147 const GstVaapiRectangle *dst_rect,
153 #endif /* GST_VAAPI_WINDOW_H */