From: Tim-Philipp Müller Date: Sun, 14 Aug 2011 00:47:41 +0000 (+0100) Subject: tag: id3v2: add debug category for ID3 tag parsing X-Git-Tag: 1.19.3~511^2~6555^2~650 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f25c71510454bca5405d85197cb7f741c79e5ed9;p=platform%2Fupstream%2Fgstreamer.git tag: id3v2: add debug category for ID3 tag parsing --- diff --git a/gst-libs/gst/tag/id3v2.c b/gst-libs/gst/tag/id3v2.c index 5c99262..a8bcdba 100644 --- a/gst-libs/gst/tag/id3v2.c +++ b/gst-libs/gst/tag/id3v2.c @@ -31,6 +31,28 @@ static gboolean id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size); +#ifndef GST_DISABLE_GST_DEBUG + +#define GST_CAT_DEFAULT id3v2_ensure_debug_category() + +GstDebugCategory * +id3v2_ensure_debug_category (void) +{ + static gsize cat_gonce = 0; + + if (g_once_init_enter (&cat_gonce)) { + gsize cat; + + cat = (gsize) _gst_debug_category_new ("id3v2", 0, "ID3v2 tag parsing"); + + g_once_init_leave (&cat_gonce, cat); + } + + return (GstDebugCategory *) cat_gonce; +} + +#endif /* GST_DISABLE_GST_DEBUG */ + guint id3v2_read_synch_uint (const guint8 * data, guint size) { diff --git a/gst-libs/gst/tag/id3v2.h b/gst-libs/gst/tag/id3v2.h index d9ce504..fd21bb6 100644 --- a/gst-libs/gst/tag/id3v2.h +++ b/gst-libs/gst/tag/id3v2.h @@ -113,6 +113,8 @@ gboolean id3v2_parse_frame (ID3TagsWorking *work); guint8 * id3v2_ununsync_data (const guint8 * unsync_data, guint32 * size); +GstDebugCategory * id3v2_ensure_debug_category (void); + G_END_DECLS #endif diff --git a/gst-libs/gst/tag/id3v2frames.c b/gst-libs/gst/tag/id3v2frames.c index f6b997c..78aa80e 100644 --- a/gst-libs/gst/tag/id3v2frames.c +++ b/gst-libs/gst/tag/id3v2frames.c @@ -35,6 +35,10 @@ #include "id3v2.h" +#ifndef GST_DISABLE_GST_DEBUG +#define GST_CAT_DEFAULT id3v2_ensure_debug_category() +#endif + static gboolean parse_comment_frame (ID3TagsWorking * work); static gchar *parse_url_link_frame (ID3TagsWorking * work, const gchar ** tag_name);