From 0fba38f833bd9713c58f388f9d9b0a5ea1defbb9 Mon Sep 17 00:00:00 2001 From: Austin Lund Date: Fri, 11 Jun 2010 10:53:26 +1000 Subject: [PATCH] mpegvideoparse: Added debugging output for mpegpacketiser --- gst/mpegvideoparse/mpegpacketiser.c | 28 +++++++++++++--------------- gst/mpegvideoparse/mpegvideoparse.c | 2 +- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/gst/mpegvideoparse/mpegpacketiser.c b/gst/mpegvideoparse/mpegpacketiser.c index 994b4afc99..8eff4cf44a 100644 --- a/gst/mpegvideoparse/mpegpacketiser.c +++ b/gst/mpegvideoparse/mpegpacketiser.c @@ -31,6 +31,9 @@ * otherwise it is accumulated with the GOP */ #include "mpegpacketiser.h" +GST_DEBUG_CATEGORY_EXTERN (mpv_parse_debug); +#define GST_CAT_DEFAULT mpv_parse_debug + static void collect_packets (MPEGPacketiser * p, GstBuffer * buf); void @@ -149,12 +152,11 @@ get_next_free_block (MPEGPacketiser * p) /* Now we may need to move some data up to the end of the array, if the * cur_block_idx is before the first_block_idx in the array. */ if (p->cur_block_idx < p->first_block_idx) { -#if 0 - g_print ("Moving %d blocks from idx %d to idx %d of %d\n", + + GST_LOG ("Moving %d blocks from idx %d to idx %d of %d", old_n_blocks - p->first_block_idx, p->first_block_idx, p->first_block_idx + BLOCKS_INCREMENT, p->n_blocks); -#endif memmove (p->blocks + p->first_block_idx + BLOCKS_INCREMENT, p->blocks + p->first_block_idx, @@ -188,10 +190,8 @@ complete_current_block (MPEGPacketiser * p, guint64 offset) g_assert (block->offset < offset); block->length = offset - block->offset; -#if 0 - g_print ("Completed block of type 0x%02x @ offset %" G_GUINT64_FORMAT - " with size %u\n", block->first_pack_type, block->offset, block->length); -#endif + GST_LOG ("Completed block of type 0x%02x @ offset %" G_GUINT64_FORMAT + " with size %u", block->first_pack_type, block->offset, block->length); /* If this is the first complete block, set first_block_idx to be this block */ if (p->first_block_idx == -1) @@ -283,16 +283,16 @@ start_new_block (MPEGPacketiser * p, guint64 offset, guint8 pack_type) /* Make this our current block */ p->cur_block_idx = block_idx; -#if 0 - g_print ("Started new block in slot %d with first pack 0x%02x @ offset %" - G_GUINT64_FORMAT "\n", block_idx, block->first_pack_type, block->offset); -#endif + GST_LOG ("Started new block in slot %d with first pack 0x%02x @ offset %" + G_GUINT64_FORMAT, block_idx, block->first_pack_type, block->offset); } static void handle_packet (MPEGPacketiser * p, guint64 offset, guint8 pack_type) { + GST_LOG ("handle_packet: offset %" G_GUINT64_FORMAT ", pack_type %2x", offset, + pack_type); switch (pack_type) { case MPEG_PACKET_SEQUENCE: case MPEG_PACKET_GOP: @@ -335,10 +335,8 @@ handle_packet (MPEGPacketiser * p, guint64 offset, guint8 pack_type) if (G_LIKELY (p->cur_block_idx != -1)) { block = p->blocks + p->cur_block_idx; block->ts = ts; -#if 0 - g_print ("Picture @ offset %" G_GINT64_FORMAT " has ts %" - GST_TIME_FORMAT "\n", block->offset, GST_TIME_ARGS (block->ts)); -#endif + GST_LOG ("Picture @ offset %" G_GINT64_FORMAT " has ts %" + GST_TIME_FORMAT, block->offset, GST_TIME_ARGS (block->ts)); } break; } diff --git a/gst/mpegvideoparse/mpegvideoparse.c b/gst/mpegvideoparse/mpegvideoparse.c index 36216fc282..70fdc89af3 100644 --- a/gst/mpegvideoparse/mpegvideoparse.c +++ b/gst/mpegvideoparse/mpegvideoparse.c @@ -41,7 +41,7 @@ * sequence changes, but if we then seek to a different spot it might * be wrong. Fortunately almost every stream only has 1 sequence. */ -GST_DEBUG_CATEGORY_STATIC (mpv_parse_debug); +GST_DEBUG_CATEGORY (mpv_parse_debug); #define GST_CAT_DEFAULT mpv_parse_debug static GstStaticPadTemplate src_template =