aggregator: Actually handle NEED_DATA return from update_src_caps()

The documentation says that this allows the subclass to signal that it
needs more data before it can decide on caps, so let's actually
implement it that way.
This commit is contained in:
Sebastian Dröge 2019-08-14 09:51:55 +03:00
parent 21798184a0
commit e024926636

View file

@ -1034,6 +1034,9 @@ gst_aggregator_update_src_caps (GstAggregator * self)
if (ret < GST_FLOW_OK) { if (ret < GST_FLOW_OK) {
GST_WARNING_OBJECT (self, "Subclass failed to update provided caps"); GST_WARNING_OBJECT (self, "Subclass failed to update provided caps");
goto done; goto done;
} else if (ret == GST_AGGREGATOR_FLOW_NEED_DATA) {
GST_DEBUG_OBJECT (self, "Subclass needs more data to decide on caps");
goto done;
} }
if ((caps == NULL || gst_caps_is_empty (caps)) && ret >= GST_FLOW_OK) { if ((caps == NULL || gst_caps_is_empty (caps)) && ret >= GST_FLOW_OK) {
ret = GST_FLOW_NOT_NEGOTIATED; ret = GST_FLOW_NOT_NEGOTIATED;
@ -1147,6 +1150,8 @@ gst_aggregator_aggregate_func (GstAggregator * self)
flow_return = gst_aggregator_update_src_caps (self); flow_return = gst_aggregator_update_src_caps (self);
if (flow_return != GST_FLOW_OK) if (flow_return != GST_FLOW_OK)
gst_pad_mark_reconfigure (GST_AGGREGATOR_SRC_PAD (self)); gst_pad_mark_reconfigure (GST_AGGREGATOR_SRC_PAD (self));
if (flow_return == GST_AGGREGATOR_FLOW_NEED_DATA)
flow_return = GST_FLOW_OK;
} }
if (timeout || flow_return >= GST_FLOW_OK) { if (timeout || flow_return >= GST_FLOW_OK) {