mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 10:10:32 +00:00
aggregator: Start the task when linked
Until now we would start the task when the pad is activated. Part of the activiation concist of testing if the pipeline is live or not. Unfortunatly, this is often too soon, as it's likely that the pad get activated before it is fully linked in dynamic pipeline. Instead, start the task when the first serialized event arrive. This is a safe moment as we know that the upstream chain is complete and just like the pad activation, the pads are locked, hence cannot change. https://bugzilla.gnome.org/show_bug.cgi?id=757548
This commit is contained in:
parent
834015009f
commit
3b05c55222
1 changed files with 7 additions and 6 deletions
|
@ -922,10 +922,12 @@ gst_aggregator_start_srcpad_task (GstAggregator * self)
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (self, "Starting srcpad task");
|
GST_INFO_OBJECT (self, "Starting srcpad task");
|
||||||
|
|
||||||
|
if (gst_pad_is_active (self->srcpad)) {
|
||||||
self->priv->running = TRUE;
|
self->priv->running = TRUE;
|
||||||
gst_pad_start_task (GST_PAD (self->srcpad),
|
gst_pad_start_task (GST_PAD (self->srcpad),
|
||||||
(GstTaskFunction) gst_aggregator_aggregate_func, self, NULL);
|
(GstTaskFunction) gst_aggregator_aggregate_func, self, NULL);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_aggregator_flush (GstAggregator * self)
|
gst_aggregator_flush (GstAggregator * self)
|
||||||
|
@ -1137,6 +1139,7 @@ gst_aggregator_default_sink_event (GstAggregator * self,
|
||||||
}
|
}
|
||||||
case GST_EVENT_STREAM_START:
|
case GST_EVENT_STREAM_START:
|
||||||
{
|
{
|
||||||
|
gst_aggregator_start_srcpad_task (self);
|
||||||
goto eat;
|
goto eat;
|
||||||
}
|
}
|
||||||
case GST_EVENT_GAP:
|
case GST_EVENT_GAP:
|
||||||
|
@ -1363,7 +1366,6 @@ gst_aggregator_request_new_pad (GstElement * element,
|
||||||
GstAggregator *self;
|
GstAggregator *self;
|
||||||
GstAggregatorPad *agg_pad;
|
GstAggregatorPad *agg_pad;
|
||||||
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (element);
|
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (element);
|
||||||
GstAggregatorPrivate *priv = GST_AGGREGATOR (element)->priv;
|
|
||||||
|
|
||||||
self = GST_AGGREGATOR (element);
|
self = GST_AGGREGATOR (element);
|
||||||
|
|
||||||
|
@ -1376,7 +1378,7 @@ gst_aggregator_request_new_pad (GstElement * element,
|
||||||
GST_DEBUG_OBJECT (element, "Adding pad %s", GST_PAD_NAME (agg_pad));
|
GST_DEBUG_OBJECT (element, "Adding pad %s", GST_PAD_NAME (agg_pad));
|
||||||
self->priv->has_peer_latency = FALSE;
|
self->priv->has_peer_latency = FALSE;
|
||||||
|
|
||||||
if (priv->running)
|
if (gst_pad_is_active (self->srcpad))
|
||||||
gst_pad_set_active (GST_PAD (agg_pad), TRUE);
|
gst_pad_set_active (GST_PAD (agg_pad), TRUE);
|
||||||
|
|
||||||
/* add the pad to the element */
|
/* add the pad to the element */
|
||||||
|
@ -1785,7 +1787,6 @@ gst_aggregator_src_pad_activate_mode_func (GstPad * pad,
|
||||||
case GST_PAD_MODE_PUSH:
|
case GST_PAD_MODE_PUSH:
|
||||||
{
|
{
|
||||||
GST_INFO_OBJECT (pad, "Activating pad!");
|
GST_INFO_OBJECT (pad, "Activating pad!");
|
||||||
gst_aggregator_start_srcpad_task (self);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue