decodebin3: Make input activation "atomic"
authorEdward Hervey <edward@centricular.com>
Thu, 19 Nov 2020 09:49:01 +0000 (10:49 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 25 Mar 2021 09:35:27 +0000 (09:35 +0000)
commite15531bb9b1e320d7892117b76cb7d5e7afcd32e
treead8ac4266740ab4ee677ef46de44a1d990b82b48
parentddf3e6669fcfcaeb3205af698d66c8ec1648f4b3
decodebin3: Make input activation "atomic"

When adding inputs dynamically, we need to make sure the new parsebin are
added *and* activated by the same thread (by taking the state change lock).

The rationale for this is that the calling thread might be an upstream streaming
thread and when activating parsebin it might call back upstream. If we don't use
the same thread (ex: when the application does a state change on decodebin3
between the moment we add parsebin to decodebin3 and we synchronize the state of
parsebin) then we would end up in different threads trying to take upstream
recursive locks.

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