1 /*
2  * GStreamer
3  * Copyright (C) 2012 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_VULKAN_WINDOW_XCB_H__
22 #define __GST_VULKAN_WINDOW_XCB_H__
23 
24 #include <xcb/xcb.h>
25 
26 #include <vk.h>
27 
28 G_BEGIN_DECLS
29 
30 #define GST_TYPE_VULKAN_WINDOW_XCB         (gst_vulkan_window_xcb_get_type())
31 #define GST_VULKAN_WINDOW_XCB(o)           (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_WINDOW_XCB, GstVulkanWindowXCB))
32 #define GST_VULKAN_WINDOW_XCB_CLASS(k)     (G_TYPE_CHECK_CLASS((k), GST_TYPE_VULKAN_WINDOW_XCB, GstVulkanWindowXCBClass))
33 #define GST_IS_VULKAN_WINDOW_XCB(o)        (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_WINDOW_XCB))
34 #define GST_IS_VULKAN_WINDOW_XCB_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_WINDOW_XCB))
35 #define GST_VULKAN_WINDOW_XCB_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_WINDOW_XCB, GstVulkanWindowXCBClass))
36 
37 typedef struct _GstVulkanWindowXCB        GstVulkanWindowXCB;
38 typedef struct _GstVulkanWindowXCBPrivate GstVulkanWindowXCBPrivate;
39 typedef struct _GstVulkanWindowXCBClass   GstVulkanWindowXCBClass;
40 
41 /**
42  * GstVulkanWindowXCB:
43  *
44  * Opaque #GstVulkanWindowXCB object
45  */
46 struct _GstVulkanWindowXCB
47 {
48   /*< private >*/
49   GstVulkanWindow parent;
50 
51   /* X window */
52   xcb_window_t win_id;
53 
54   gint          visible :1;
55 
56   PFN_vkCreateXcbSurfaceKHR CreateXcbSurface;
57   PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR GetPhysicalDeviceXcbPresentationSupport;
58 
59   /*< private >*/
60   GstVulkanWindowXCBPrivate *priv;
61 
62   gpointer _reserved[GST_PADDING];
63 };
64 
65 /**
66  * GstVulkanWindowXCBClass:
67  *
68  * Opaque #GstVulkanWindowXCBClass object
69  */
70 struct _GstVulkanWindowXCBClass {
71   /*< private >*/
72   GstVulkanWindowClass parent_class;
73 
74   /*< private >*/
75   gpointer _reserved[GST_PADDING_LARGE];
76 };
77 
78 GType gst_vulkan_window_xcb_get_type     (void);
79 
80 GstVulkanWindowXCB * gst_vulkan_window_xcb_new (GstVulkanDisplay * display);
81 
82 gboolean gst_vulkan_window_xcb_create_window (GstVulkanWindowXCB * window_xcb);
83 
84 G_END_DECLS
85 
86 #endif /* __GST_VULKAN_WINDOW_XCB_H__ */
87