1 /*
2  * GStreamer
3  * Copyright (C) 2013 Matthew Waters <ystreet00@gmail.com>
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_GL_DISPLAY_X11_H__
22 #define __GST_GL_DISPLAY_X11_H__
23 
24 #include <gst/gst.h>
25 
26 #include <X11/Xlib-xcb.h>
27 
28 #include <gst/gl/gstgldisplay.h>
29 
30 G_BEGIN_DECLS
31 
32 GST_GL_API
33 GType gst_gl_display_x11_get_type (void);
34 
35 #define GST_TYPE_GL_DISPLAY_X11             (gst_gl_display_x11_get_type())
36 #define GST_GL_DISPLAY_X11(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GL_DISPLAY_X11,GstGLDisplayX11))
37 #define GST_GL_DISPLAY_X11_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_GL_DISPLAY_X11,GstGLDisplayX11Class))
38 #define GST_IS_GL_DISPLAY_X11(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GL_DISPLAY_X11))
39 #define GST_IS_GL_DISPLAY_X11_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_GL_DISPLAY_X11))
40 #define GST_GL_DISPLAY_X11_CAST(obj)        ((GstGLDisplayX11*)(obj))
41 
42 typedef struct _GstGLDisplayX11 GstGLDisplayX11;
43 typedef struct _GstGLDisplayX11Class GstGLDisplayX11Class;
44 
45 /**
46  * GstGLDisplayX11:
47  *
48  * the contents of a #GstGLDisplayX11 are private and should only be accessed
49  * through the provided API
50  */
51 struct _GstGLDisplayX11
52 {
53   /*< private >*/
54   GstGLDisplay          parent;
55 
56   gchar *name;
57   Display *display;
58   xcb_connection_t *xcb_connection;
59   gboolean foreign_display;
60 
61   gpointer _padding[GST_PADDING];
62 };
63 
64 struct _GstGLDisplayX11Class
65 {
66   GstGLDisplayClass object_class;
67 
68   gpointer _padding[GST_PADDING];
69 };
70 
71 GST_GL_API
72 GstGLDisplayX11 *gst_gl_display_x11_new (const gchar * name);
73 
74 GST_GL_API
75 GstGLDisplayX11 *gst_gl_display_x11_new_with_display (Display *display);
76 
77 G_END_DECLS
78 
79 #endif /* __GST_GL_DISPLAY_X11_H__ */
80