From 9ee58b5aeb806ecf6efdc39e4869821420557245 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 19 Mar 2018 10:55:06 +0100 Subject: [PATCH] closedcaption: zvbi: Add gst-debug category to zvbi code And adapt their logging system to go through it --- ext/closedcaption/decoder.c | 7 +++++++ ext/closedcaption/decoder.h | 2 ++ ext/closedcaption/misc.h | 16 +++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ext/closedcaption/decoder.c b/ext/closedcaption/decoder.c index 083a88544e..b74e72956d 100644 --- a/ext/closedcaption/decoder.c +++ b/ext/closedcaption/decoder.c @@ -827,6 +827,13 @@ vbi_raw_decoder_init (vbi_raw_decoder * rd) rd->pattern = (int8_t *) rd3; } +GST_DEBUG_CATEGORY (libzvbi_debug); +void +vbi_initialize_gst_debug (void) +{ + GST_DEBUG_CATEGORY_INIT (libzvbi_debug, "libzvbi", 0, "libzvbi"); +} + /* Local variables: c-set-style: K&R diff --git a/ext/closedcaption/decoder.h b/ext/closedcaption/decoder.h index 04dfd20c91..f91e705a0b 100644 --- a/ext/closedcaption/decoder.h +++ b/ext/closedcaption/decoder.h @@ -406,6 +406,8 @@ extern void vbi_raw_decoder_resize( vbi_raw_decoder *rd, extern unsigned int vbi_raw_decoder_parameters(vbi_raw_decoder *rd, unsigned int services, int scanning, int *max_rate); extern int vbi_raw_decode(vbi_raw_decoder *rd, uint8_t *raw, vbi_sliced *out); + +void vbi_initialize_gst_debug (void); /** @} */ /* Private */ diff --git a/ext/closedcaption/misc.h b/ext/closedcaption/misc.h index 08298c42a4..bdc04ecfbd 100644 --- a/ext/closedcaption/misc.h +++ b/ext/closedcaption/misc.h @@ -295,6 +295,8 @@ _vbi_grow_vector_capacity (void ** vector, size_t element_size) _vbi_nonnull ((1, 2)); +GST_DEBUG_CATEGORY_EXTERN (libzvbi_debug); + /* Logging stuff. */ #ifdef G_HAVE_ISO_VARARGS #define VBI_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \ @@ -336,19 +338,19 @@ VBI_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level, #endif /* G_HAVE_ISO_VARARGS */ #define error(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_ERROR, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_ERROR, NULL, templ , ##args) #define warning(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_WARNING, NULL, templ , ##args) #define notice(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_INFO, NULL, templ , ##args) #define info(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_INFO, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_INFO, NULL, templ , ##args) #define debug1(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_DEBUG, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_DEBUG, NULL, templ , ##args) #define debug2(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_LOG, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_LOG, NULL, templ , ##args) #define debug3(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_TRACE, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_TRACE, NULL, templ , ##args) #if 0 /* Replaced logging with GStreamer logging system */ extern _vbi_log_hook _vbi_global_log;