aggregator: don't forward reconfigure events
authorMathieu Duponchelle <mathieu@centricular.com>
Wed, 22 Dec 2021 23:24:03 +0000 (00:24 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 27 Jan 2022 17:11:48 +0000 (17:11 +0000)
Those will cause us to renegotiate at the next aggregate cycle,
and while at that point we may decide to reconfigure upstream
branches (in practice we don't as this is inherently racy,
and that's the reason why mixer subclasses perform conversion
internally), we certainly don't want to just forward the event
willy-nilly to all our sinkpads.

An actual issue this is fixing is when caps downstream of a
compositor are changed at every samples-selected signal emission,
for the purpose of interpolating the output geometry, and the
compositor has a non-zero latency, the reconfigure events were
forwarded to basesrc, which triggered an allocation query, which
in turn caused aggregator to have to drain (thus not being able
to queue <latency> frames), leading to disastrous effects
(choppy output as compositor couldn't consume frames fast enough,
the higher the latency the choppier the output)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1464>

subprojects/gstreamer/libs/gst/base/gstaggregator.c

index b24ef48..d6c91cd 100644 (file)
@@ -2415,6 +2415,11 @@ gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event)
       /* navigation is rather pointless. */
       gst_event_unref (event);
       return FALSE;
+    case GST_EVENT_RECONFIGURE:
+      /* We will renegotiate with downstream, we don't
+       * need to forward this further */
+      gst_event_unref (event);
+      return TRUE;
     default:
       break;
   }