closedcaption: Fix compilation without debugging

This commit is contained in:
Edward Hervey 2018-05-28 15:55:57 +02:00 committed by Edward Hervey
parent a41fb3c6df
commit 5d697cd804
3 changed files with 43 additions and 15 deletions

View file

@ -205,8 +205,11 @@ gst_cea708dec_process_dtvcc_packet (Cea708Dec * decoder, guint8 * dtvcc_buffer,
guint8 service_number; guint8 service_number;
guint parse_index = 0; guint parse_index = 0;
#ifndef GST_DISABLE_GST_DEBUG
guint8 sequence_number = (dtvcc_buffer[parse_index] & 0xC0) >> 6; guint8 sequence_number = (dtvcc_buffer[parse_index] & 0xC0) >> 6;
guint8 pkt_size = DTVCC_PKT_SIZE (dtvcc_buffer[parse_index] & 0x3F); guint8 pkt_size = DTVCC_PKT_SIZE (dtvcc_buffer[parse_index] & 0x3F);
#endif
parse_index += 1; parse_index += 1;
block_size = dtvcc_buffer[parse_index] & 0x1F; block_size = dtvcc_buffer[parse_index] & 0x1F;
@ -768,8 +771,10 @@ gst_cea708dec_define_window (Cea708Dec * decoder,
gboolean visible = FALSE; gboolean visible = FALSE;
guint8 style_id = 0; guint8 style_id = 0;
guint8 pen_style_id = 0; guint8 pen_style_id = 0;
#ifndef GST_DISABLE_GST_DEBUG
guint v_anchor = 0; guint v_anchor = 0;
guint h_anchor = 0; guint h_anchor = 0;
#endif
GST_LOG ("current_window=%d", decoder->current_window); GST_LOG ("current_window=%d", decoder->current_window);
GST_LOG ("dtvcc_buffer %02x %02x %02x %02x %02x %02x", GST_LOG ("dtvcc_buffer %02x %02x %02x %02x %02x %02x",

View file

@ -1565,9 +1565,11 @@ extract_ccdata_from_cdp (const guint8 * indata, gsize insize,
{ {
GstByteReader br; GstByteReader br;
guint8 cdp_length; guint8 cdp_length;
guint8 framerate_code;
guint8 flags; guint8 flags;
#ifndef GST_DISABLE_GST_DEBUG
guint8 framerate_code;
guint16 seqhdr; guint16 seqhdr;
#endif
GST_MEMDUMP ("CDP", indata, insize); GST_MEMDUMP ("CDP", indata, insize);
@ -1589,9 +1591,17 @@ extract_ccdata_from_cdp (const guint8 * indata, gsize insize,
cdp_length, insize); cdp_length, insize);
return FALSE; return FALSE;
} }
#ifndef GST_DISABLE_GST_DEBUG
framerate_code = gst_byte_reader_get_uint8_unchecked (&br) >> 4; 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); flags = gst_byte_reader_get_uint8_unchecked (&br);
#ifndef GST_DISABLE_GST_DEBUG
seqhdr = gst_byte_reader_get_uint16_be_unchecked (&br); seqhdr = gst_byte_reader_get_uint16_be_unchecked (&br);
#else
gst_byte_reader_skip (&br, 2);
#endif
GST_DEBUG GST_DEBUG
("framerate_code : 0x%02x , flags : 0x%02x , sequencer_counter : %u", ("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 text_running_time = GST_CLOCK_TIME_NONE;
GstClockTime next_buffer_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 = vid_running_time =
gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME, gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME,
start); start);
#endif
vid_running_time_end = vid_running_time_end =
gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME, gst_segment_to_running_time (&overlay->segment, GST_FORMAT_TIME,
stop); stop);

View file

@ -297,19 +297,20 @@ _vbi_grow_vector_capacity (void ** vector,
GST_DEBUG_CATEGORY_EXTERN (libzvbi_debug); GST_DEBUG_CATEGORY_EXTERN (libzvbi_debug);
#ifndef GST_DISABLE_GST_DEBUG
/* Logging stuff. */ /* Logging stuff. */
#ifdef G_HAVE_ISO_VARARGS #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)) { \ 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__); \ (GObject *) (object), __VA_ARGS__); \
} \ } \
}G_STMT_END }G_STMT_END
#else /* G_HAVE_GNUC_VARARGS */ #else /* G_HAVE_GNUC_VARARGS */
#ifdef 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)) { \ 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 ); \ (GObject *) (object), ##args ); \
} \ } \
}G_STMT_END }G_STMT_END
@ -325,32 +326,39 @@ VBI_CAT_LEVEL_LOG_valist (GstDebugCategory * cat,
} }
static inline void static inline void
VBI_CAT_LEVEL_LOG (GstDebugCategory * cat, GstDebugLevel level, VBI_CAT_LEVEL_LOG (GstDebugLevel level,
gpointer object, const char *format, ...) gpointer object, const char *format, ...)
{ {
va_list varargs; va_list varargs;
va_start (varargs, format); 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); va_end (varargs);
} }
#endif #endif
#endif /* G_HAVE_ISO_VARARGS */ #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...) \ #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...) \ #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...) \ #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...) \ #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...) \ #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...) \ #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...) \ #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 */ #if 0 /* Replaced logging with GStreamer logging system */
extern _vbi_log_hook _vbi_global_log; extern _vbi_log_hook _vbi_global_log;