summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2020-06-13 17:29:57 +1000
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-06-21 09:30:29 +0000
commit595dd1c1499bb2eb7026aeab32c54dbfe45c0e5e (patch)
tree8d8df4609475ad2f2d2637a7990a1a218a59c899 /gst-libs
parentc213b6ea1703049745fa55c54a7eac713890dc8e (diff)
downloadgstreamer-plugins-bad-595dd1c1499bb2eb7026aeab32c54dbfe45c0e5e.tar.gz
vulkan/wayland: initialise debug category before debug logging
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1341>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c b/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
index 1bd17a303..eda063de9 100644
--- a/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
+++ b/gst-libs/gst/vulkan/wayland/gstvkwindow_wayland.c
@@ -34,21 +34,33 @@
#define GST_CAT_DEFAULT gst_vulkan_window_wayland_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
+static void
+_init_debug (void)
+{
+ static volatile gsize _init = 0;
+
+ if (g_once_init_enter (&_init)) {
+ GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "vulkanwindowxcb", 0,
+ "Vulkan XCB Window");
+ g_once_init_leave (&_init, 1);
+ }
+}
+
#define gst_vulkan_window_wayland_parent_class parent_class
-G_DEFINE_TYPE (GstVulkanWindowWayland, gst_vulkan_window_wayland,
- GST_TYPE_VULKAN_WINDOW)
+G_DEFINE_TYPE_WITH_CODE (GstVulkanWindowWayland, gst_vulkan_window_wayland,
+ GST_TYPE_VULKAN_WINDOW, _init_debug ());
- static void gst_vulkan_window_wayland_close (GstVulkanWindow * window);
- static gboolean gst_vulkan_window_wayland_open (GstVulkanWindow * window,
+static void gst_vulkan_window_wayland_close (GstVulkanWindow * window);
+static gboolean gst_vulkan_window_wayland_open (GstVulkanWindow * window,
GError ** error);
- static VkSurfaceKHR gst_vulkan_window_wayland_get_surface (GstVulkanWindow
+static VkSurfaceKHR gst_vulkan_window_wayland_get_surface (GstVulkanWindow
* window, GError ** error);
- static gboolean
- gst_vulkan_window_wayland_get_presentation_support (GstVulkanWindow *
+static gboolean
+gst_vulkan_window_wayland_get_presentation_support (GstVulkanWindow *
window, GstVulkanDevice * device, guint32 queue_family_idx);
- static void
- handle_ping (void *data, struct wl_shell_surface *shell_surface,
+static void
+handle_ping (void *data, struct wl_shell_surface *shell_surface,
uint32_t serial)
{
GstVulkanWindowWayland *window_wl = data;
@@ -175,6 +187,8 @@ gst_vulkan_window_wayland_new (GstVulkanDisplay * display)
/* we require a wayland display to create wayland surfaces */
return NULL;
+ _init_debug ();
+
GST_DEBUG ("creating Wayland window");
window = g_object_new (GST_TYPE_VULKAN_WINDOW_WAYLAND, NULL);