From 5d697cd8048e4c3640b72795f957f33d034cb756 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 28 May 2018 15:55:57 +0200 Subject: [PATCH] closedcaption: Fix compilation without debugging --- ext/closedcaption/gstcea708decoder.c | 5 ++++ ext/closedcaption/gstceaccoverlay.c | 19 ++++++++++++++-- ext/closedcaption/misc.h | 34 +++++++++++++++++----------- 3 files changed, 43 insertions(+), 15 deletions(-) diff --git a/ext/closedcaption/gstcea708decoder.c b/ext/closedcaption/gstcea708decoder.c index 73a408086c..fac1546faf 100644 --- a/ext/closedcaption/gstcea708decoder.c +++ b/ext/closedcaption/gstcea708decoder.c @@ -205,8 +205,11 @@ gst_cea708dec_process_dtvcc_packet (Cea708Dec * decoder, guint8 * dtvcc_buffer, guint8 service_number; guint parse_index = 0; +#ifndef GST_DISABLE_GST_DEBUG guint8 sequence_number = (dtvcc_buffer[parse_index] & 0xC0) >> 6; guint8 pkt_size = DTVCC_PKT_SIZE (dtvcc_buffer[parse_index] & 0x3F); +#endif + parse_index += 1; block_size = dtvcc_buffer[parse_index] & 0x1F; @@ -768,8 +771,10 @@ gst_cea708dec_define_window (Cea708Dec * decoder, gboolean visible = FALSE; guint8 style_id = 0; guint8 pen_style_id = 0; +#ifndef GST_DISABLE_GST_DEBUG guint v_anchor = 0; guint h_anchor = 0; +#endif GST_LOG ("current_window=%d", decoder->current_window); GST_LOG ("dtvcc_buffer %02x %02x %02x %02x %02x %02x", diff --git a/ext/closedcaption/gstceaccoverlay.c b/ext/closedcaption/gstceaccoverlay.c index 5fe051eec0..5747b9aa2e 100644 --- a/ext/closedcaption/gstceaccoverlay.c +++ b/ext/closedcaption/gstceaccoverlay.c @@ -1565,9 +1565,11 @@ extract_ccdata_from_cdp (const guint8 * indata, gsize insize, { GstByteReader br; guint8 cdp_length; - guint8 framerate_code; guint8 flags; +#ifndef GST_DISABLE_GST_DEBUG + guint8 framerate_code; guint16 seqhdr; +#endif GST_MEMDUMP ("CDP", indata, insize); @@ -1589,9 +1591,17 @@ extract_ccdata_from_cdp (const guint8 * indata, gsize insize, cdp_length, insize); return FALSE; } +#ifndef GST_DISABLE_GST_DEBUG framerate_code = gst_byte_reader_get_uint8_unchecked (&br) >> 4; +#else + gst_byte_reader_skip (&br, 1); +#endif flags = gst_byte_reader_get_uint8_unchecked (&br); +#ifndef GST_DISABLE_GST_DEBUG seqhdr = gst_byte_reader_get_uint16_be_unchecked (&br); +#else + gst_byte_reader_skip (&br, 2); +#endif GST_DEBUG ("framerate_code : 0x%02x , flags : 0x%02x , sequencer_counter : %u", @@ -1800,11 +1810,16 @@ wait_for_text_buf: GstClockTime text_running_time = GST_CLOCK_TIME_NONE; GstClockTime next_buffer_text_running_time = GST_CLOCK_TIME_NONE; - GstClockTime vid_running_time, vid_running_time_end; +#ifndef GST_DISABLE_GST_DEBUG + GstClockTime vid_running_time; +#endif + GstClockTime vid_running_time_end; +#ifndef GST_DISABLE_GST_DEBUG vid_running_time = gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME, start); +#endif vid_running_time_end = gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME, stop); diff --git a/ext/closedcaption/misc.h b/ext/closedcaption/misc.h index bdc04ecfbd..b00e43693b 100644 --- a/ext/closedcaption/misc.h +++ b/ext/closedcaption/misc.h @@ -297,19 +297,20 @@ _vbi_grow_vector_capacity (void ** vector, GST_DEBUG_CATEGORY_EXTERN (libzvbi_debug); +#ifndef GST_DISABLE_GST_DEBUG /* Logging stuff. */ #ifdef G_HAVE_ISO_VARARGS -#define VBI_CAT_LEVEL_LOG(cat,level,object,...) G_STMT_START{ \ +#define VBI_CAT_LEVEL_LOG(level,object,...) G_STMT_START{ \ if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \ - gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \ + gst_debug_log (libzvbi_debug, (level), __FILE__, GST_FUNCTION, __LINE__, \ (GObject *) (object), __VA_ARGS__); \ } \ }G_STMT_END #else /* G_HAVE_GNUC_VARARGS */ #ifdef G_HAVE_GNUC_VARARGS -#define VBI_CAT_LEVEL_LOG(cat,level,object,args...) G_STMT_START{ \ +#define VBI_CAT_LEVEL_LOG(level,object,args...) G_STMT_START{ \ if (G_UNLIKELY ((level) <= GST_LEVEL_MAX && (level) <= _gst_debug_min)) { \ - gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \ + gst_debug_log (libzvbi_debug, (level), __FILE__, GST_FUNCTION, __LINE__, \ (GObject *) (object), ##args ); \ } \ }G_STMT_END @@ -325,32 +326,39 @@ VBI_CAT_LEVEL_LOG_valist (GstDebugCategory * cat, } static inline void -VBI_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level, +VBI_CAT_LEVEL_LOG (GstDebugLevel level, gpointer object, const char *format, ...) { va_list varargs; va_start (varargs, format); - GST_CAT_LEVEL_LOG_valist (cat, level, object, format, varargs); + GST_CAT_LEVEL_LOG_valist (libzvbi_debug, level, object, format, varargs); va_end (varargs); } #endif #endif /* G_HAVE_ISO_VARARGS */ +#else +static inline void +VBI_CAT_LEVEL_LOG (GstDebugLevel level, + gpointer object, const char *format, ...) +{ +} +#endif /* GST_DISABLE_GST_DEBUG */ #define error(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_ERROR, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_ERROR, NULL, templ , ##args) #define warning(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_WARNING, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_WARNING, NULL, templ , ##args) #define notice(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_INFO, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_INFO, NULL, templ , ##args) #define info(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_INFO, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_INFO, NULL, templ , ##args) #define debug1(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_DEBUG, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_DEBUG, NULL, templ , ##args) #define debug2(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_LOG, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_LOG, NULL, templ , ##args) #define debug3(hook, templ, args...) \ - VBI_CAT_LEVEL_LOG (libzvbi_debug, GST_LEVEL_TRACE, NULL, templ , ##args) + VBI_CAT_LEVEL_LOG (GST_LEVEL_TRACE, NULL, templ , ##args) #if 0 /* Replaced logging with GStreamer logging system */ extern _vbi_log_hook _vbi_global_log;