mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
aggregator: Improve debug output to better understand why pads are not ready or can't accept more data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2907>
This commit is contained in:
parent
b10fc4d8db
commit
d9bd870db4
1 changed files with 26 additions and 11 deletions
|
@ -495,12 +495,14 @@ gst_aggregator_check_pads_ready (GstAggregator * self,
|
||||||
|| GST_IS_QUERY (g_queue_peek_tail (&pad->priv->data)))) {
|
|| GST_IS_QUERY (g_queue_peek_tail (&pad->priv->data)))) {
|
||||||
PAD_UNLOCK (pad);
|
PAD_UNLOCK (pad);
|
||||||
have_event_or_query = TRUE;
|
have_event_or_query = TRUE;
|
||||||
|
GST_LOG_OBJECT (pad, "Have pending serialized query/event");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->priv->ignore_inactive_pads && self->priv->peer_latency_live &&
|
if (self->priv->ignore_inactive_pads && self->priv->peer_latency_live &&
|
||||||
pad->priv->waited_once && pad->priv->first_buffer && !pad->priv->eos) {
|
pad->priv->waited_once && pad->priv->first_buffer && !pad->priv->eos) {
|
||||||
PAD_UNLOCK (pad);
|
PAD_UNLOCK (pad);
|
||||||
|
GST_LOG_OBJECT (pad, "Ignoring inactive pad");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,11 +516,17 @@ gst_aggregator_check_pads_ready (GstAggregator * self,
|
||||||
|
|
||||||
/* Only consider this pad as worth waiting for if it's not already EOS.
|
/* Only consider this pad as worth waiting for if it's not already EOS.
|
||||||
* There's no point in waiting for buffers on EOS pads */
|
* There's no point in waiting for buffers on EOS pads */
|
||||||
if (!pad->priv->eos)
|
if (!pad->priv->eos) {
|
||||||
|
GST_LOG_OBJECT (pad, "Have no buffer and not EOS yet");
|
||||||
have_buffer = FALSE;
|
have_buffer = FALSE;
|
||||||
else
|
} else {
|
||||||
|
GST_LOG_OBJECT (pad, "Have no buffer and already EOS");
|
||||||
n_ready++;
|
n_ready++;
|
||||||
} else if (self->priv->peer_latency_live) {
|
}
|
||||||
|
} else {
|
||||||
|
GST_TRACE_OBJECT (pad, "Have %" GST_TIME_FORMAT " queued in %u buffers",
|
||||||
|
GST_TIME_ARGS (pad->priv->time_level), pad->priv->num_buffers);
|
||||||
|
if (self->priv->peer_latency_live) {
|
||||||
/* In live mode, having a single pad with buffers is enough to
|
/* In live mode, having a single pad with buffers is enough to
|
||||||
* generate a start time from it. In non-live mode all pads need
|
* generate a start time from it. In non-live mode all pads need
|
||||||
* to have a buffer
|
* to have a buffer
|
||||||
|
@ -526,6 +534,7 @@ gst_aggregator_check_pads_ready (GstAggregator * self,
|
||||||
self->priv->first_buffer = FALSE;
|
self->priv->first_buffer = FALSE;
|
||||||
n_ready++;
|
n_ready++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PAD_UNLOCK (pad);
|
PAD_UNLOCK (pad);
|
||||||
}
|
}
|
||||||
|
@ -563,7 +572,7 @@ no_sinkpads:
|
||||||
}
|
}
|
||||||
pad_not_ready:
|
pad_not_ready:
|
||||||
{
|
{
|
||||||
GST_LOG_OBJECT (pad, "pad not ready to be aggregated yet");
|
GST_LOG_OBJECT (self, "pad not ready to be aggregated yet");
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
if (have_event_or_query_ret)
|
if (have_event_or_query_ret)
|
||||||
|
@ -573,7 +582,7 @@ pad_not_ready:
|
||||||
}
|
}
|
||||||
pad_not_ready_but_event_or_query:
|
pad_not_ready_but_event_or_query:
|
||||||
{
|
{
|
||||||
GST_LOG_OBJECT (pad,
|
GST_LOG_OBJECT (self,
|
||||||
"pad not ready to be aggregated yet, need to handle serialized event or query first");
|
"pad not ready to be aggregated yet, need to handle serialized event or query first");
|
||||||
GST_OBJECT_UNLOCK (self);
|
GST_OBJECT_UNLOCK (self);
|
||||||
|
|
||||||
|
@ -2986,6 +2995,9 @@ gst_aggregator_pad_has_space (GstAggregator * self, GstAggregatorPad * aggpad)
|
||||||
{
|
{
|
||||||
guint64 max_time_level;
|
guint64 max_time_level;
|
||||||
|
|
||||||
|
GST_TRACE_OBJECT (aggpad, "Have %" GST_TIME_FORMAT " queued in %u buffers",
|
||||||
|
GST_TIME_ARGS (aggpad->priv->time_level), aggpad->priv->num_buffers);
|
||||||
|
|
||||||
/* Empty queue always has space */
|
/* Empty queue always has space */
|
||||||
if (aggpad->priv->num_buffers == 0 && aggpad->priv->clipped_buffer == NULL)
|
if (aggpad->priv->num_buffers == 0 && aggpad->priv->clipped_buffer == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -3004,6 +3016,9 @@ gst_aggregator_pad_has_space (GstAggregator * self, GstAggregatorPad * aggpad)
|
||||||
* upstream latency. */
|
* upstream latency. */
|
||||||
max_time_level = self->priv->latency + self->priv->upstream_latency_min;
|
max_time_level = self->priv->latency + self->priv->upstream_latency_min;
|
||||||
|
|
||||||
|
GST_TRACE_OBJECT (aggpad, "Maximum queue level %" GST_TIME_FORMAT,
|
||||||
|
GST_TIME_ARGS (max_time_level));
|
||||||
|
|
||||||
/* Allow no more buffers than the latency */
|
/* Allow no more buffers than the latency */
|
||||||
return (aggpad->priv->time_level <= max_time_level);
|
return (aggpad->priv->time_level <= max_time_level);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue