Add gst_vaapi_window_set_fullscreen() API.
[platform/upstream/gstreamer-vaapi.git] / gst-libs / gst / vaapi / gstvaapiwindow.h
1 /*
2  *  gstvaapiwindow.h - VA window abstraction
3  *
4  *  gstreamer-vaapi (C) 2010 Splitted-Desktop Systems
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #ifndef GST_VAAPI_WINDOW_H
22 #define GST_VAAPI_WINDOW_H
23
24 #include <gst/video/gstvideosink.h>
25 #include <gst/vaapi/gstvaapidisplay.h>
26 #include <gst/vaapi/gstvaapisurface.h>
27
28 G_BEGIN_DECLS
29
30 #define GST_VAAPI_TYPE_WINDOW \
31     (gst_vaapi_window_get_type())
32
33 #define GST_VAAPI_WINDOW(obj)                           \
34     (G_TYPE_CHECK_INSTANCE_CAST((obj),                  \
35                                 GST_VAAPI_TYPE_WINDOW,  \
36                                 GstVaapiWindow))
37
38 #define GST_VAAPI_WINDOW_CLASS(klass)                   \
39     (G_TYPE_CHECK_CLASS_CAST((klass),                   \
40                              GST_VAAPI_TYPE_WINDOW,     \
41                              GstVaapiWindowClass))
42
43 #define GST_VAAPI_IS_WINDOW(obj) \
44     (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_VAAPI_TYPE_WINDOW))
45
46 #define GST_VAAPI_IS_WINDOW_CLASS(klass) \
47     (G_TYPE_CHECK_CLASS_TYPE((klass), GST_VAAPI_TYPE_WINDOW))
48
49 #define GST_VAAPI_WINDOW_GET_CLASS(obj)                 \
50     (G_TYPE_INSTANCE_GET_CLASS((obj),                   \
51                                GST_VAAPI_TYPE_WINDOW,   \
52                                GstVaapiWindowClass))
53
54 typedef struct _GstVaapiWindow                  GstVaapiWindow;
55 typedef struct _GstVaapiWindowPrivate           GstVaapiWindowPrivate;
56 typedef struct _GstVaapiWindowClass             GstVaapiWindowClass;
57
58 /**
59  * GstVaapiWindow:
60  *
61  * Base class for system-dependent windows.
62  */
63 struct _GstVaapiWindow {
64     /*< private >*/
65     GObject parent_instance;
66
67     GstVaapiWindowPrivate *priv;
68 };
69
70 /**
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
79  *
80  * Base class for system-dependent windows.
81  */
82 struct _GstVaapiWindowClass {
83     /*< private >*/
84     GObjectClass parent_class;
85
86     /*< public >*/
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,
97                            guint flags);
98 };
99
100 GType
101 gst_vaapi_window_get_type(void);
102
103 void
104 gst_vaapi_window_show(GstVaapiWindow *window);
105
106 void
107 gst_vaapi_window_hide(GstVaapiWindow *window);
108
109 void
110 gst_vaapi_window_set_fullscreen(GstVaapiWindow *window, gboolean fullscreen);
111
112 guint
113 gst_vaapi_window_get_width(GstVaapiWindow *window);
114
115 guint
116 gst_vaapi_window_get_height(GstVaapiWindow *window);
117
118 void
119 gst_vaapi_window_get_size(GstVaapiWindow *window, guint *pwidth, guint *pheight);
120
121 void
122 gst_vaapi_window_set_width(GstVaapiWindow *window, guint width);
123
124 void
125 gst_vaapi_window_set_height(GstVaapiWindow *window, guint height);
126
127 void
128 gst_vaapi_window_set_size(GstVaapiWindow *window, guint width, guint height);
129
130 gboolean
131 gst_vaapi_window_put_surface(
132     GstVaapiWindow          *window,
133     GstVaapiSurface         *surface,
134     const GstVideoRectangle *src_rect,
135     const GstVideoRectangle *dst_rect,
136     guint                    flags
137 );
138
139 G_END_DECLS
140
141 #endif /* GST_VAAPI_WINDOW_H */