waylandsink: get the external display handle using GstContext
[platform/upstream/gstreamer.git] / gst-libs / gst / wayland / wayland.h
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 #include <gst/gst.h>
25 #include <wayland-client.h>
26
27 G_BEGIN_DECLS
28
29 /* The type of GstContext used to pass the wl_display pointer
30  * from the application to the sink */
31 #define GST_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE "GstWaylandDisplayHandleContextType"
32
33 #define GST_TYPE_WAYLAND_VIDEO \
34     (gst_wayland_video_get_type ())
35 #define GST_WAYLAND_VIDEO(obj) \
36     (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WAYLAND_VIDEO, GstWaylandVideo))
37 #define GST_IS_WAYLAND_VIDEO(obj) \
38     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WAYLAND_VIDEO))
39 #define GST_WAYLAND_VIDEO_GET_INTERFACE(inst) \
40     (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GST_TYPE_WAYLAND_VIDEO, GstWaylandVideoInterface))
41
42 /**
43  * GstWaylandVideo:
44  *
45  * Opaque #GstWaylandVideo interface structure
46  */
47 typedef struct _GstWaylandVideo GstWaylandVideo;
48 typedef struct _GstWaylandVideoInterface GstWaylandVideoInterface;
49
50
51 /**
52  * GstWaylandVideoInterface:
53  * @iface: parent interface type.
54  *
55  * #GstWaylandVideo interface
56  */
57 struct _GstWaylandVideoInterface {
58   GTypeInterface iface;
59
60   /* virtual functions */
61   void (*set_surface_size)     (GstWaylandVideo *video, gint w, gint h);
62   void (*pause_rendering)      (GstWaylandVideo *video);
63   void (*resume_rendering)     (GstWaylandVideo *video);
64 };
65
66 GType   gst_wayland_video_get_type (void);
67
68 /* virtual function wrappers */
69
70 void gst_wayland_video_set_surface_size (GstWaylandVideo * video,
71         gint w, gint h);
72
73 void gst_wayland_video_pause_rendering (GstWaylandVideo * video);
74 void gst_wayland_video_resume_rendering (GstWaylandVideo * video);
75
76 G_END_DECLS
77
78 #endif /* __GST_WAYLAND_H__ */