gstreamer/gst
Michael Olbrich 5bfb78aa28 decodebin3: improve decoder selection
Currently the decoder selection is very naive: The type with the highest
rank that matches the current caps is used. This works well for software
decoders. The exact supported caps are always known and the static caps are
defined accordingly.
With hardware decoders, e.g. vaapi, the situation is different. The decoder
may reject the caps later during a caps query. At that point, a new decoder
is created. However, the same type is chosen an after several tries,
decodebin fails.

To avoid this, do the caps query while adding the decoder and try again
with other decoder types if the query fails:

1. create the decoder from the next matching type
2. add and link the decoder
3. change the decoder state to READY
4. do the caps query
   if it fails then remove the decoder again and go back to 1.
5. expose the source pad
6. sync the decoder state with the parent.

This way, the decoder is already part of the pipeline when the state change
to READY happens. So context handling should work as before.

Exposing the source pad after the query was successful is important:
Otherwise the thread from the decoder source pad may block in a blocked pad
downstream in the playsink waiting for other pads to be ready.
The thread now blocks trying to set the state back to NULL while holding
the SELECTION_LOCK. Other streams may block on the SELECTION_LOCK and the
playsink never unblocks the pad. The result is a deadlock.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1201>
2021-07-19 08:56:35 +00:00
..
adder gst: don't use volatile to mean atomic 2021-03-19 04:20:19 +00:00
app app: allow per feature registration 2021-03-16 17:58:59 +00:00
audioconvert audioconvert: update doc for mix-matrix 2021-03-17 14:26:54 +01:00
audiomixer audiomixer: allow per feature registration 2021-03-16 17:58:59 +00:00
audiorate audiorate: allow per feature registration 2021-03-29 14:06:00 +02:00
audioresample audioresample: allow per feature registration 2021-03-29 14:06:30 +02:00
audiotestsrc audiotestsrc: allow per feature registration 2021-03-29 14:07:00 +02:00
compositor compositor: Add scaling policy to support PAR-aware scaling 2021-06-29 23:06:37 +09:00
encoding encodebin: handle video encoder preset fail. 2021-03-19 12:43:59 +00:00
gio gstgiobasesink: Handle incomplete writes in gst_gio_base_sink_render() 2021-04-09 07:35:07 +00:00
overlaycomposition overlaycomposition: fix cut-off example code in docs 2021-05-21 00:36:10 +01:00
pbtypes pbtypes: allow per features registration 2020-12-10 13:01:57 +00:00
playback decodebin3: improve decoder selection 2021-07-19 08:56:35 +00:00
rawparse rawbaseparse: check destination format correctly 2021-05-31 09:14:53 +02:00
subparse subparse: allow per feature registration 2020-12-10 13:01:57 +00:00
tcp multihandlesink: Use the monotonic clock for detecting timeouts and connection durations 2021-05-05 16:12:38 +00:00
typefind typefind: use new gst_type_find_suggest_empty_simple() 2021-04-01 21:44:10 -04:00
videoconvert videoconvert: allow per feature registration 2021-03-16 17:58:59 +00:00
videorate gst: don't use volatile to mean atomic 2021-03-19 04:20:19 +00:00
videoscale gst: don't use volatile to mean atomic 2021-03-19 04:20:19 +00:00
videotestsrc videotestsrc: Add SMPTE75 RP-219 color bars conformant 2021-07-01 18:03:14 +02:00
volume volume: allow per feature registration 2021-03-16 17:59:00 +00:00
meson.build compositor: add to build after move from -bad 2018-12-28 12:16:18 +01:00