typefind: Fix debug category usage
authorEdward Hervey <bilboed@bilboed.com>
Fri, 11 Dec 2020 10:40:22 +0000 (11:40 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 11 Dec 2020 13:06:30 +0000 (14:06 +0100)
Only register it in one place and use it everywhere from the header. Also make
sure it doesn't clash with the debug category from core.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/972>

gst/typefind/gsttypefindfunctions.c
gst/typefind/gsttypefindfunctionsplugin.c
gst/typefind/gsttypefindfunctionsplugin.h
gst/typefind/gsttypefindfunctionsstartwith.c

index da56455..7635e4d 100644 (file)
@@ -45,9 +45,6 @@
 
 #include "gsttypefindfunctionsplugin.h"
 
-GST_DEBUG_CATEGORY_STATIC (type_find_debug);
-#define GST_CAT_DEFAULT type_find_debug
-
 /* DataScanCtx: helper for typefind functions that scan through data
  * step-by-step, to avoid doing a peek at each and every offset */
 
index 94030d1..c0e386a 100644 (file)
 
 #include <gst/gst.h>
 
-GST_DEBUG_CATEGORY_STATIC (type_find_debug);
-#define GST_CAT_DEFAULT type_find_debug
+GST_DEBUG_CATEGORY (type_find_functions_debug);
 
 static gboolean
 plugin_init (GstPlugin * plugin)
 {
   /* can't initialize this via a struct as caps can't be statically initialized */
-  GST_DEBUG_CATEGORY_INIT (type_find_debug, "typefindfunctions",
+  GST_DEBUG_CATEGORY_INIT (type_find_functions_debug, "typefindfunctions",
       GST_DEBUG_FG_GREEN | GST_DEBUG_BG_RED, "generic type find functions");
   /* note: asx/wax/wmx are XML files, asf doesn't handle them */
   /* must use strings, macros don't accept initializers */
index 960c910..0dfbc70 100644 (file)
@@ -29,6 +29,9 @@
 
 #include <gst/gst.h>
 
+GST_DEBUG_CATEGORY_EXTERN (type_find_functions_debug);
+#define GST_CAT_DEFAULT type_find_functions_debug
+
 /*** plugin initialization ***/
 
 /*RIFF type find declaration */
index decf9a8..14092e9 100644 (file)
@@ -33,9 +33,6 @@
 #include "gsttypefindfunctionsplugin.h"
 #include "gsttypefindfunctionsdata.h"
 
-GST_DEBUG_CATEGORY_STATIC (type_find_debug);
-#define GST_CAT_DEFAULT type_find_debug
-
 static void
 start_with_type_find (GstTypeFind * tf, gpointer private)
 {