3 * Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
4 * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library 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 GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
22 #ifndef __GST_VULKAN_WINDOW_H__
23 #define __GST_VULKAN_WINDOW_H__
31 #define GST_TYPE_VULKAN_WINDOW (gst_vulkan_window_get_type())
32 #define GST_VULKAN_WINDOW(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_VULKAN_WINDOW, GstVulkanWindow))
33 #define GST_VULKAN_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GST_TYPE_VULKAN_WINDOW, GstVulkanWindowClass))
34 #define GST_IS_VULKAN_WINDOW(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_VULKAN_WINDOW))
35 #define GST_IS_VULKAN_WINDOW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_VULKAN_WINDOW))
36 #define GST_VULKAN_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_VULKAN_WINDOW, GstVulkanWindowClass))
37 GType gst_vulkan_window_get_type (void);
39 #define GST_VULKAN_WINDOW_LOCK(w) g_mutex_lock(&GST_VULKAN_WINDOW(w)->lock)
40 #define GST_VULKAN_WINDOW_UNLOCK(w) g_mutex_unlock(&GST_VULKAN_WINDOW(w)->lock)
41 #define GST_VULKAN_WINDOW_GET_LOCK(w) (&GST_VULKAN_WINDOW(w)->lock)
43 #define GST_VULKAN_WINDOW_ERROR (gst_vulkan_window_error_quark ())
44 GQuark gst_vulkan_window_error_quark (void);
48 GST_VULKAN_WINDOW_ERROR_FAILED,
49 GST_VULKAN_WINDOW_ERROR_OLD_LIBS,
50 GST_VULKAN_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
51 } GstVulkanWindowError;
56 * #GstVulkanWindow is an opaque struct and should only be accessed through the
59 struct _GstVulkanWindow {
63 GstVulkanDisplay *display;
67 GstVulkanWindowPrivate *priv;
69 gpointer _reserved[GST_PADDING];
73 * GstVulkanWindowClass:
74 * @parent_class: Parent class
75 * @open: open the connection to the display
76 * @close: close the connection to the display
78 struct _GstVulkanWindowClass {
79 GstObjectClass parent_class;
81 gboolean (*open) (GstVulkanWindow *window,
83 void (*close) (GstVulkanWindow *window);
85 VkSurfaceKHR (*get_surface) (GstVulkanWindow *window,
87 gboolean (*get_presentation_support) (GstVulkanWindow *window,
88 GstVulkanDevice *device,
89 guint32 queue_family_idx);
90 void (*set_window_handle) (GstVulkanWindow *window,
94 gpointer _reserved[GST_PADDING];
97 GstVulkanWindow * gst_vulkan_window_new (GstVulkanDisplay *display);
99 GstVulkanDisplay * gst_vulkan_window_get_display (GstVulkanWindow *window);
100 VkSurfaceKHR gst_vulkan_window_get_surface (GstVulkanWindow *window,
102 gboolean gst_vulkan_window_get_presentation_support (GstVulkanWindow *window,
103 GstVulkanDevice *device,
104 guint32 queue_family_idx);
105 void gst_vulkan_window_set_window_handle (GstVulkanWindow *window,
108 gboolean gst_vulkan_window_open (GstVulkanWindow *window,
110 void gst_vulkan_window_close (GstVulkanWindow *window);
112 void gst_vulkan_window_resize (GstVulkanWindow *window,
115 void gst_vulkan_window_redraw (GstVulkanWindow *window);
119 #endif /* __GST_VULKAN_WINDOW_H__ */