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;
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;
}
#define MPEGTS_MIN_PACKETSIZE MPEGTS_NORMAL_PACKETSIZE
#define MPEGTS_MAX_PACKETSIZE MPEGTS_ATSC_PACKETSIZE
-#define MPEGTS_AFC_PCR_FLAG 0x10
-#define MPEGTS_AFC_OPCR_FLAG 0x08
+#define MPEGTS_AFC_PCR_FLAG 0x10
+#define MPEGTS_AFC_OPCR_FLAG 0x08
+#define MPEGTS_AFC_SPLICING_POINT_FLAG 0x04
+#define MPEGTS_AFC_TRANSPORT_PRIVATE_DATA_FLAG 0x02
+#define MPEGTS_AFC_EXTENSION_FLAG 0x01
#define MAX_WINDOW 512
guint8 afc_flags;
guint64 pcr;
- guint64 opcr;
guint64 offset;
} MpegTSPacketizerPacket;
res->flags = val8 & 0xf;
GST_LOG ("scrambling_control 0x%0x", res->scrambling_control);
+ GST_LOG ("flags_1: %s%s%s%s%s",
+ val8 & 0x08 ? "priority " : "",
+ val8 & 0x04 ? "data_alignment " : "",
+ val8 & 0x02 ? "copyright " : "",
+ val8 & 0x01 ? "original_or_copy " : "", val8 & 0x0f ? "" : "<none>");
/* PTS_DTS_flags 2
* ESCR_flag 1
* PES_CRC_flag 1
* PES_extension_flag 1*/
flags = *data++;
- GST_DEBUG ("PES_flag 0x%02x", flags);
+ GST_LOG ("flags_2: %s%s%s%s%s%s%s%s%s",
+ flags & 0x80 ? "PTS " : "",
+ flags & 0x40 ? "DTS " : "",
+ flags & 0x20 ? "ESCR" : "",
+ flags & 0x10 ? "ES_rate " : "",
+ flags & 0x08 ? "DSM_trick_mode " : "",
+ flags & 0x04 ? "additional_copy_info " : "",
+ flags & 0x02 ? "CRC " : "",
+ flags & 0x01 ? "extension " : "", flags ? "" : "<none>");
/* PES_header_data_length 8 */
res->header_size = *data++;