closedcaption: zvbi: Add gst-debug category to zvbi code

And adapt their logging system to go through it
This commit is contained in:
Edward Hervey 2018-03-19 10:55:06 +01:00 committed by Edward Hervey
parent af9e9d613a
commit 9ee58b5aeb
3 changed files with 18 additions and 7 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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;