decodebin3: Make update/posting of collection messages atomic
authorEdward Hervey <edward@centricular.com>
Tue, 1 Oct 2024 15:17:01 +0000 (17:17 +0200)
committerBackport Bot <gitlab-backport-bot@gstreamer-foundation.org>
Wed, 2 Oct 2024 22:06:07 +0000 (23:06 +0100)
commit9eacd548473141ebbbb719e9ddf3fe5d9e739234
treed21ebd120bd9c83ae8206a09362466f6e4349c74
parentf805aa2d60a2e4bd4fdc666c7e1a29ea86faab02
decodebin3: Make update/posting of collection messages atomic

The presence (or not) of a collection on an input will determine whether events
will be throttled so that there are only forwarded when that input gets a valid
collection.

Therefore the input lock should be used.

In addition to that, we want to ensure that the application/user has a chance to
reliably (i.e. synchronously) specify what streams it is interested in by
sending a GST_EVENT_SELECT_STREAMS.

But we cannot allow anything to go forward until that message posting has come
back, otherwise we run in various races.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3872

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7602>
subprojects/gst-plugins-base/gst/playback/gstdecodebin3.c