1 /*
2  * GStreamer Wayland Library
3  * Copyright (C) 2014 Collabora Ltd.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_WAYLAND_H__
22 #define __GST_WAYLAND_H__
23 
24 #ifndef GST_USE_UNSTABLE_API
25 #warning "The GStreamer wayland library is unstable API and may change in future."
26 #warning "You can define GST_USE_UNSTABLE_API to avoid this warning."
27 #endif
28 
29 #include <gst/gst.h>
30 #include <wayland-client.h>
31 
32 #ifndef GST_WAYLAND_API
33 # ifdef BUILDING_GST_WAYLAND
34 #  define GST_WAYLAND_API GST_API_EXPORT         /* from config.h */
35 # else
36 #  define GST_WAYLAND_API GST_API_IMPORT
37 # endif
38 #endif
39 
40 G_BEGIN_DECLS
41 
42 /* The type of GstContext used to pass the wl_display pointer
43  * from the application to the sink */
44 #define GST_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE "GstWaylandDisplayHandleContextType"
45 
46 GST_WAYLAND_API
47 gboolean gst_is_wayland_display_handle_need_context_message (GstMessage * msg);
48 
49 GST_WAYLAND_API
50 GstContext *
51 gst_wayland_display_handle_context_new (struct wl_display * display);
52 
53 GST_WAYLAND_API
54 struct wl_display *
55 gst_wayland_display_handle_context_get_handle (GstContext * context);
56 
57 
58 #define GST_TYPE_WAYLAND_VIDEO \
59     (gst_wayland_video_get_type ())
60 #define GST_WAYLAND_VIDEO(obj) \
61     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WAYLAND_VIDEO, GstWaylandVideo))
62 #define GST_IS_WAYLAND_VIDEO(obj) \
63     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WAYLAND_VIDEO))
64 #define GST_WAYLAND_VIDEO_GET_INTERFACE(inst) \
65     (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_WAYLAND_VIDEO, GstWaylandVideoInterface))
66 
67 /**
68  * GstWaylandVideo:
69  *
70  * Opaque #GstWaylandVideo interface structure
71  */
72 typedef struct _GstWaylandVideo GstWaylandVideo;
73 typedef struct _GstWaylandVideoInterface GstWaylandVideoInterface;
74 
75 
76 /**
77  * GstWaylandVideoInterface:
78  * @iface: parent interface type.
79  *
80  * #GstWaylandVideo interface
81  */
82 struct _GstWaylandVideoInterface {
83   GTypeInterface iface;
84 
85   /* virtual functions */
86   void (*begin_geometry_change)    (GstWaylandVideo *video);
87   void (*end_geometry_change)     (GstWaylandVideo *video);
88 };
89 
90 GST_WAYLAND_API
91 GType   gst_wayland_video_get_type (void);
92 
93 /* virtual function wrappers */
94 GST_WAYLAND_API
95 void gst_wayland_video_begin_geometry_change (GstWaylandVideo * video);
96 
97 GST_WAYLAND_API
98 void gst_wayland_video_end_geometry_change (GstWaylandVideo * video);
99 
100 G_END_DECLS
101 
102 #endif /* __GST_WAYLAND_H__ */
103