diff options
author | Edward Hervey <edward@collabora.com> | 2013-07-26 07:53:06 +0200 |
---|---|---|
committer | Edward Hervey <edward@collabora.com> | 2013-07-26 08:17:17 +0200 |
commit | 8c60e420700bc121166c59f991d33cea6cd15205 (patch) | |
tree | f44732c642b80dd694bb0f6ff6f90355012ae780 /gst/mpegtsdemux/mpegtspacketizer.c | |
parent | 3b6825a5465bddce5e48965370e74a8e9bf01db8 (diff) |
mpegtsdemux: Add more flag debugging for PES and TS packets
Helps with debugging issues. And also remove unused variable (opcr)
This will also allow us in the future to properly detect:
* random-access location (to enable keyframe observation and
potentially seeking
* discont location (to properly handle resets)
* splice location (to properly handle new stream changes)
Diffstat (limited to 'gst/mpegtsdemux/mpegtspacketizer.c')
-rw-r--r-- | gst/mpegtsdemux/mpegtspacketizer.c | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/gst/mpegtsdemux/mpegtspacketizer.c b/gst/mpegtsdemux/mpegtspacketizer.c index 2432469c28..8ed14c05fb 100644 --- a/gst/mpegtsdemux/mpegtspacketizer.c +++ b/gst/mpegtsdemux/mpegtspacketizer.c @@ -406,6 +406,16 @@ mpegts_packetizer_parse_adaptation_field_control (MpegTSPacketizer2 * afcflags = packet->afc_flags = *data++; + GST_DEBUG ("flags: %s%s%s%s%s%s%s%s%s", + afcflags & 0x80 ? "discontinuity " : "", + afcflags & 0x40 ? "random_access " : "", + afcflags & 0x20 ? "elementary_stream_priority " : "", + afcflags & 0x10 ? "PCR " : "", + afcflags & 0x08 ? "OPCR " : "", + afcflags & 0x04 ? "splicing_point " : "", + afcflags & 0x02 ? "transport_private_data " : "", + afcflags & 0x01 ? "extension " : "", afcflags == 0x00 ? "<none>" : ""); + /* PCR */ if (afcflags & MPEGTS_AFC_PCR_FLAG) { MpegTSPCR *pcrtable = NULL; @@ -426,15 +436,41 @@ mpegts_packetizer_parse_adaptation_field_control (MpegTSPacketizer2 * record_pcr (packetizer, pcrtable, packet->pcr, packet->offset); } } - +#ifndef GST_DISABLE_GST_DEBUG /* OPCR */ if (afcflags & MPEGTS_AFC_OPCR_FLAG) { - packet->opcr = mpegts_packetizer_compute_pcr (data); - /* *data += 6; */ + /* Note: We don't use/need opcr for the time being */ + guint64 opcr = mpegts_packetizer_compute_pcr (data); + data += 6; GST_DEBUG ("opcr %" G_GUINT64_FORMAT " (%" GST_TIME_FORMAT ")", - packet->pcr, GST_TIME_ARGS (PCRTIME_TO_GSTTIME (packet->pcr))); + opcr, GST_TIME_ARGS (PCRTIME_TO_GSTTIME (opcr))); + } + + if (afcflags & MPEGTS_AFC_SPLICING_POINT_FLAG) { + GST_DEBUG ("splice_countdown: %u", *data++); } + if (afcflags & MPEGTS_AFC_TRANSPORT_PRIVATE_DATA_FLAG) { + guint8 len = *data++; + GST_MEMDUMP ("private data", data, len); + data += len; + } + + if (afcflags & MPEGTS_AFC_EXTENSION_FLAG) { + guint8 extlen = *data++; + guint8 flags = *data++; + GST_DEBUG ("extension size:%d flags : %s%s%s", extlen, + flags & 0x80 ? "ltw " : "", + flags & 0x40 ? "piecewise_rate " : "", + flags & 0x20 ? "seamless_splice " : ""); + if (flags & 0x80) { + GST_DEBUG ("legal time window: valid_flag:%d offset:%d", *data >> 7, + GST_READ_UINT16_BE (data) & 0x7fff); + data += 2; + } + } +#endif + return TRUE; } |