wpe: Logging fixes for the WebExtension
authorPhilippe Normand <philn@igalia.com>
Thu, 22 Dec 2022 10:17:42 +0000 (10:17 +0000)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 21 Feb 2023 15:17:08 +0000 (15:17 +0000)
Using logging macros without a `GST_CAT_DEFAULT` in scope leads to critical
warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4022>

subprojects/gst-plugins-bad/ext/wpe/WPEThreadedView.cpp
subprojects/gst-plugins-bad/ext/wpe/wpe-extension/gstwpeextension.c

index f81726c..f630872 100644 (file)
@@ -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);
index 256b264..bcdfa9b 100644 (file)
@@ -30,6 +30,9 @@
 #include <gio/gunixfdlist.h>
 #include <wpe/webkit-web-extension.h>
 
+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