From f12769b86000b5596d9c31eb8c33457e62cc507e Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Thu, 22 Dec 2022 10:17:42 +0000 Subject: [PATCH] wpe: Logging fixes for the WebExtension Using logging macros without a `GST_CAT_DEFAULT` in scope leads to critical warnings. Part-of: --- subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp | 1 + .../ext/wpe/wpe-extension/gstwpeextension.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp b/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp index 0c10bc242b..954cfc83e6 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp +++ b/subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp @@ -296,6 +296,7 @@ webkit_extension_msg_received (WebKitWebContext *context, GVariant *params = webkit_user_message_get_parameters (message); gboolean res = TRUE; + GST_TRACE_OBJECT(src, "Handling message %s", name); if (!g_strcmp0(name, "gstwpe.new_stream")) { guint32 id = g_variant_get_uint32 (g_variant_get_child_value (params, 0)); const gchar *capsstr = g_variant_get_string (g_variant_get_child_value (params, 1), NULL); diff --git a/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/gstwpeextension.c b/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/gstwpeextension.c index 256b264ef8..bcdfa9b765 100644 --- a/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/gstwpeextension.c +++ b/subprojects/gst-plugins-bad/ext/wpe/wpe-extension/gstwpeextension.c @@ -30,6 +30,9 @@ #include #include +GST_DEBUG_CATEGORY_STATIC (wpe_extension_debug); +#define GST_CAT_DEFAULT wpe_extension_debug + G_MODULE_EXPORT void webkit_web_extension_initialize (WebKitWebExtension * extension); @@ -42,13 +45,16 @@ webkit_web_extension_initialize (WebKitWebExtension * extension) gst_init (NULL, NULL); + GST_DEBUG_CATEGORY_INIT (wpe_extension_debug, "wpewebextension", 0, + "GstWPE WebExtension"); + /* Register our own audio sink to */ gst_element_register (NULL, "gstwpeaudiosink", GST_RANK_PRIMARY + 500, gst_wpe_audio_sink_get_type ()); gst_object_unref (g_object_new (gst_wpe_bus_msg_forwarder_get_type (), NULL)); global_extension = extension; - GST_INFO_OBJECT (global_extension, "Setting as global extension."); + GST_INFO ("Setting as global extension."); } void