From 391b4309f9654cd2ed1d0016d068e78e7ec8624a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 1 Mar 2012 17:39:17 +0100 Subject: [PATCH] meta: improve debugging Add category for metadata debug --- gst/gst_private.h | 2 ++ gst/gstinfo.c | 2 ++ gst/gstmeta.c | 10 +++++++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gst/gst_private.h b/gst/gst_private.h index 5e2b857432..0b2823f4bb 100644 --- a/gst/gst_private.h +++ b/gst/gst_private.h @@ -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 diff --git a/gst/gstinfo.c b/gst/gstinfo.c index cd97195290..9c0871fb45 100644 --- a/gst/gstinfo.c +++ b/gst/gstinfo.c @@ -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 */ diff --git a/gst/gstmeta.c b/gst/gstmeta.c index d81743b256..97431a21f4 100644 --- a/gst/gstmeta.c +++ b/gst/gstmeta.c @@ -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);