meta: improve debugging
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 1 Mar 2012 16:39:17 +0000 (17:39 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 1 Mar 2012 16:41:57 +0000 (17:41 +0100)
Add category for metadata debug

gst/gst_private.h
gst/gstinfo.c
gst/gstmeta.c

index 5e2b857..0b2823f 100644 (file)
@@ -198,6 +198,7 @@ GST_EXPORT GstDebugCategory *GST_CAT_SIGNAL;
 GST_EXPORT GstDebugCategory *GST_CAT_PROBE;
 GST_EXPORT GstDebugCategory *GST_CAT_REGISTRY;
 GST_EXPORT GstDebugCategory *GST_CAT_QOS;
+GST_EXPORT GstDebugCategory *GST_CAT_META;
 
 /* Categories that should be completely private to
  * libgstreamer should be done like this: */
@@ -238,6 +239,7 @@ extern GstDebugCategory *_priv_GST_CAT_POLL;
 #define GST_CAT_QOS              NULL
 #define GST_CAT_TYPES            NULL
 #define GST_CAT_POLL             NULL
+#define GST_CAT_META             NULL
 
 #endif
 
index cd97195..9c0871f 100644 (file)
@@ -168,6 +168,7 @@ GstDebugCategory *GST_CAT_PROBE = NULL;
 GstDebugCategory *GST_CAT_REGISTRY = NULL;
 GstDebugCategory *GST_CAT_QOS = NULL;
 GstDebugCategory *_priv_GST_CAT_POLL = NULL;
+GstDebugCategory *GST_CAT_META = NULL;
 
 
 #endif /* !defined(GST_DISABLE_GST_DEBUG) || !defined(GST_REMOVE_DISABLED) */
@@ -404,6 +405,7 @@ _priv_gst_debug_init (void)
   GST_CAT_REGISTRY = _gst_debug_category_new ("GST_REGISTRY", 0, "registry");
   GST_CAT_QOS = _gst_debug_category_new ("GST_QOS", 0, "QoS");
   _priv_GST_CAT_POLL = _gst_debug_category_new ("GST_POLL", 0, "poll");
+  GST_CAT_META = _gst_debug_category_new ("GST_META", 0, "meta");
 
 
   /* print out the valgrind message if we're in valgrind */
index d81743b..97431a2 100644 (file)
@@ -66,14 +66,17 @@ gst_meta_api_type_register (const gchar * api, const gchar ** tags)
   g_return_val_if_fail (api != NULL, 0);
   g_return_val_if_fail (tags != NULL, 0);
 
+  GST_CAT_DEBUG (GST_CAT_META, "register API \"%s\"", api);
   type = g_pointer_type_register_static (api);
 
   if (type != 0) {
     gint i;
 
-    for (i = 0; tags[i]; i++)
+    for (i = 0; tags[i]; i++) {
+      GST_CAT_DEBUG (GST_CAT_META, "  adding tag \"%s\"", tags[i]);
       g_type_set_qdata (type, g_quark_from_string (tags[i]),
           GINT_TO_POINTER (TRUE));
+    }
   }
   return type;
 }
@@ -134,8 +137,9 @@ gst_meta_register (GType api, const gchar * impl, gsize size,
   info->free_func = free_func;
   info->transform_func = transform_func;
 
-  GST_DEBUG ("register \"%s\" implementing \"%s\" of size %" G_GSIZE_FORMAT,
-      api, impl, size);
+  GST_CAT_DEBUG (GST_CAT_META,
+      "register \"%s\" implementing \"%s\" of size %" G_GSIZE_FORMAT, impl,
+      g_type_name (api), size);
 
   g_rw_lock_writer_lock (&lock);
   g_hash_table_insert (metainfo, (gpointer) impl, (gpointer) info);