mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-03 16:09:39 +00:00
mpegtsdemux: Change debugging levels for very frequent messages.
This allows debugging with mpegtsdemux:4 while being able to track what's going on (and avoid taking up as much cpu for debugging as for the actual demuxing process).
This commit is contained in:
parent
5aa3358f3b
commit
432dd98321
1 changed files with 16 additions and 14 deletions
|
@ -843,7 +843,7 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
|
||||||
demux = stream->demux;
|
demux = stream->demux;
|
||||||
srcpad = stream->pad;
|
srcpad = stream->pad;
|
||||||
|
|
||||||
GST_LOG_OBJECT (demux, "got data on PID 0x%04x", stream->PID);
|
GST_DEBUG_OBJECT (demux, "got data on PID 0x%04x", stream->PID);
|
||||||
|
|
||||||
if (first && filter->pts != -1) {
|
if (first && filter->pts != -1) {
|
||||||
pts = filter->pts;
|
pts = filter->pts;
|
||||||
|
@ -947,7 +947,7 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
|
||||||
pts = -1;
|
pts = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_LOG_OBJECT (demux, "setting PTS to (%" G_GUINT64_FORMAT ") time: %"
|
GST_DEBUG_OBJECT (demux, "setting PTS to (%" G_GUINT64_FORMAT ") time: %"
|
||||||
GST_TIME_FORMAT " on buffer %p first buffer: %d base_time: %"
|
GST_TIME_FORMAT " on buffer %p first buffer: %d base_time: %"
|
||||||
GST_TIME_FORMAT, pts, GST_TIME_ARGS (time), buffer, first,
|
GST_TIME_FORMAT, pts, GST_TIME_ARGS (time), buffer, first,
|
||||||
GST_TIME_ARGS (stream->base_time));
|
GST_TIME_ARGS (stream->base_time));
|
||||||
|
@ -996,7 +996,7 @@ gst_mpegts_demux_data_cb (GstPESFilter * filter, gboolean first,
|
||||||
gst_mpegts_demux_send_new_segment (demux, stream, pts);
|
gst_mpegts_demux_send_new_segment (demux, stream, pts);
|
||||||
}
|
}
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "pushing buffer");
|
GST_DEBUG_OBJECT (srcpad, "pushing buffer");
|
||||||
gst_buffer_set_caps (buffer, GST_PAD_CAPS (srcpad));
|
gst_buffer_set_caps (buffer, GST_PAD_CAPS (srcpad));
|
||||||
ret = gst_pad_push (srcpad, buffer);
|
ret = gst_pad_push (srcpad, buffer);
|
||||||
ret = gst_mpegts_demux_combine_flows (demux, stream, ret);
|
ret = gst_mpegts_demux_combine_flows (demux, stream, ret);
|
||||||
|
@ -1199,16 +1199,16 @@ gst_mpegts_stream_parse_pmt (GstMpegTSStream * stream,
|
||||||
if (gst_mpegts_demux_calc_crc32 (data - 3, datalen) != 0)
|
if (gst_mpegts_demux_calc_crc32 (data - 3, datalen) != 0)
|
||||||
goto wrong_crc;
|
goto wrong_crc;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "PMT section_length: %d", datalen - 3);
|
GST_LOG_OBJECT (demux, "PMT section_length: %d", datalen - 3);
|
||||||
|
|
||||||
PMT = &stream->PMT;
|
PMT = &stream->PMT;
|
||||||
|
|
||||||
/* check if version number changed */
|
/* check if version number changed */
|
||||||
version_number = (data[2] & 0x3e) >> 1;
|
version_number = (data[2] & 0x3e) >> 1;
|
||||||
GST_DEBUG_OBJECT (demux, "PMT version_number: %d", version_number);
|
GST_LOG_OBJECT (demux, "PMT version_number: %d", version_number);
|
||||||
|
|
||||||
current_next_indicator = (data[2] & 0x01);
|
current_next_indicator = (data[2] & 0x01);
|
||||||
GST_DEBUG_OBJECT (demux, "PMT current_next_indicator %d",
|
GST_LOG_OBJECT (demux, "PMT current_next_indicator %d",
|
||||||
current_next_indicator);
|
current_next_indicator);
|
||||||
if (current_next_indicator == 0)
|
if (current_next_indicator == 0)
|
||||||
goto not_yet_applicable;
|
goto not_yet_applicable;
|
||||||
|
@ -1574,7 +1574,7 @@ gst_mpegts_demux_parse_adaptation_field (GstMpegTSStream * stream,
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
guint8 flags = *data++;
|
guint8 flags = *data++;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "flags 0x%02x", flags);
|
GST_LOG_OBJECT (demux, "flags 0x%02x", flags);
|
||||||
/* discontinuity flag */
|
/* discontinuity flag */
|
||||||
if (flags & 0x80) {
|
if (flags & 0x80) {
|
||||||
GST_DEBUG_OBJECT (demux, "discontinuity flag set");
|
GST_DEBUG_OBJECT (demux, "discontinuity flag set");
|
||||||
|
@ -1593,9 +1593,12 @@ gst_mpegts_demux_parse_adaptation_field (GstMpegTSStream * stream,
|
||||||
pcr_ext = (pcr2 & 0x01ff);
|
pcr_ext = (pcr2 & 0x01ff);
|
||||||
if (pcr_ext)
|
if (pcr_ext)
|
||||||
pcr = (pcr * 300 + pcr_ext % 300) / 300;
|
pcr = (pcr * 300 + pcr_ext % 300) / 300;
|
||||||
GST_DEBUG_OBJECT (demux, "have PCR %" G_GUINT64_FORMAT " on PID 0x%04x "
|
GST_DEBUG_OBJECT (demux,
|
||||||
"and last pcr is %" G_GUINT64_FORMAT,
|
"have PCR %" G_GUINT64_FORMAT "(%" GST_TIME_FORMAT ") on PID 0x%04x "
|
||||||
pcr, stream->PID, stream->last_PCR);
|
"and last pcr is %" G_GUINT64_FORMAT " (%" GST_TIME_FORMAT ")", pcr,
|
||||||
|
GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (pcr)), stream->PID,
|
||||||
|
stream->last_PCR,
|
||||||
|
GST_TIME_ARGS (MPEGTIME_TO_GSTTIME (stream->last_PCR)));
|
||||||
/* pcr has been converted into units of 90Khz ticks
|
/* pcr has been converted into units of 90Khz ticks
|
||||||
* so assume discont if last pcr was > 900000 (10 second) lower */
|
* so assume discont if last pcr was > 900000 (10 second) lower */
|
||||||
if (stream->last_PCR != -1 &&
|
if (stream->last_PCR != -1 &&
|
||||||
|
@ -2119,7 +2122,7 @@ gst_mpegts_demux_parse_stream (GstMpegTSDemux * demux, GstMpegTSStream * stream,
|
||||||
data += 3;
|
data += 3;
|
||||||
datalen -= 3;
|
datalen -= 3;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (demux, "afc 0x%x, pusi %d, PID 0x%04x datalen %u",
|
GST_LOG_OBJECT (demux, "afc 0x%x, pusi %d, PID 0x%04x datalen %u",
|
||||||
adaptation_field_control, payload_unit_start_indicator, PID, datalen);
|
adaptation_field_control, payload_unit_start_indicator, PID, datalen);
|
||||||
|
|
||||||
ret = GST_FLOW_OK;
|
ret = GST_FLOW_OK;
|
||||||
|
@ -2141,13 +2144,12 @@ gst_mpegts_demux_parse_stream (GstMpegTSDemux * demux, GstMpegTSStream * stream,
|
||||||
|
|
||||||
data += consumed;
|
data += consumed;
|
||||||
datalen -= consumed;
|
datalen -= consumed;
|
||||||
GST_DEBUG_OBJECT (demux, "consumed: %u datalen: %u", consumed, datalen);
|
GST_LOG_OBJECT (demux, "consumed: %u datalen: %u", consumed, datalen);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this packet has a payload, handle it */
|
/* If this packet has a payload, handle it */
|
||||||
if (adaptation_field_control & 0x1) {
|
if (adaptation_field_control & 0x1) {
|
||||||
GST_DEBUG_OBJECT (demux, "Packet payload %d bytes, PID 0x%04x", datalen,
|
GST_LOG_OBJECT (demux, "Packet payload %d bytes, PID 0x%04x", datalen, PID);
|
||||||
PID);
|
|
||||||
|
|
||||||
/* For unknown streams, check if the PID is in the partial PIDs
|
/* For unknown streams, check if the PID is in the partial PIDs
|
||||||
* list as an elementary stream and override the type if so
|
* list as an elementary stream and override the type if so
|
||||||
|
|
Loading…
Reference in a new issue