mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-01 21:18:52 +00:00
mpegvideoparse: Added debugging output for mpegpacketiser
This commit is contained in:
parent
0bd69b0ad9
commit
0fba38f833
2 changed files with 14 additions and 16 deletions
|
@ -31,6 +31,9 @@
|
||||||
* otherwise it is accumulated with the GOP */
|
* otherwise it is accumulated with the GOP */
|
||||||
#include "mpegpacketiser.h"
|
#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);
|
static void collect_packets (MPEGPacketiser * p, GstBuffer * buf);
|
||||||
|
|
||||||
void
|
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
|
/* 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. */
|
* cur_block_idx is before the first_block_idx in the array. */
|
||||||
if (p->cur_block_idx < p->first_block_idx) {
|
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,
|
old_n_blocks - p->first_block_idx,
|
||||||
p->first_block_idx, p->first_block_idx + BLOCKS_INCREMENT,
|
p->first_block_idx, p->first_block_idx + BLOCKS_INCREMENT,
|
||||||
p->n_blocks);
|
p->n_blocks);
|
||||||
#endif
|
|
||||||
|
|
||||||
memmove (p->blocks + p->first_block_idx + BLOCKS_INCREMENT,
|
memmove (p->blocks + p->first_block_idx + BLOCKS_INCREMENT,
|
||||||
p->blocks + p->first_block_idx,
|
p->blocks + p->first_block_idx,
|
||||||
|
@ -188,10 +190,8 @@ complete_current_block (MPEGPacketiser * p, guint64 offset)
|
||||||
g_assert (block->offset < offset);
|
g_assert (block->offset < offset);
|
||||||
block->length = offset - block->offset;
|
block->length = offset - block->offset;
|
||||||
|
|
||||||
#if 0
|
GST_LOG ("Completed block of type 0x%02x @ offset %" G_GUINT64_FORMAT
|
||||||
g_print ("Completed block of type 0x%02x @ offset %" G_GUINT64_FORMAT
|
" with size %u", block->first_pack_type, block->offset, block->length);
|
||||||
" with size %u\n", block->first_pack_type, block->offset, block->length);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* If this is the first complete block, set first_block_idx to be this block */
|
/* If this is the first complete block, set first_block_idx to be this block */
|
||||||
if (p->first_block_idx == -1)
|
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 */
|
/* Make this our current block */
|
||||||
p->cur_block_idx = block_idx;
|
p->cur_block_idx = block_idx;
|
||||||
|
|
||||||
#if 0
|
GST_LOG ("Started new block in slot %d with first pack 0x%02x @ offset %"
|
||||||
g_print ("Started new block in slot %d with first pack 0x%02x @ offset %"
|
G_GUINT64_FORMAT, block_idx, block->first_pack_type, block->offset);
|
||||||
G_GUINT64_FORMAT "\n", block_idx, block->first_pack_type, block->offset);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_packet (MPEGPacketiser * p, guint64 offset, guint8 pack_type)
|
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) {
|
switch (pack_type) {
|
||||||
case MPEG_PACKET_SEQUENCE:
|
case MPEG_PACKET_SEQUENCE:
|
||||||
case MPEG_PACKET_GOP:
|
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)) {
|
if (G_LIKELY (p->cur_block_idx != -1)) {
|
||||||
block = p->blocks + p->cur_block_idx;
|
block = p->blocks + p->cur_block_idx;
|
||||||
block->ts = ts;
|
block->ts = ts;
|
||||||
#if 0
|
GST_LOG ("Picture @ offset %" G_GINT64_FORMAT " has ts %"
|
||||||
g_print ("Picture @ offset %" G_GINT64_FORMAT " has ts %"
|
GST_TIME_FORMAT, block->offset, GST_TIME_ARGS (block->ts));
|
||||||
GST_TIME_FORMAT "\n", block->offset, GST_TIME_ARGS (block->ts));
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
* sequence changes, but if we then seek to a different spot it might
|
* sequence changes, but if we then seek to a different spot it might
|
||||||
* be wrong. Fortunately almost every stream only has 1 sequence.
|
* 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
|
#define GST_CAT_DEFAULT mpv_parse_debug
|
||||||
|
|
||||||
static GstStaticPadTemplate src_template =
|
static GstStaticPadTemplate src_template =
|
||||||
|
|
Loading…
Reference in a new issue