Skip to content

playbin3, decodebin3: Refactoring for gapless and other improvements

Edward Hervey requested to merge bilboed/gstreamer:gapless-ng into main

This MR finally implements the original design for gapless playback with playbin3 and (uri)decodebin3.

Note: This was initially based on top of the buffering improvements MR : !3374 (closed)

The main goal is to re-use as much as possible existing elements, especially decoders and sinks. This is done by moving the "source" switch in uridecodebin3 before decodebin3. From the outside the API is the same as before : wait for about-to-finish and the set the uri.

  • playbin3 only uses a single uridecodebin3 and almost everything is forwarded directly to that instance.
  • uridecodebin3 handles gapless, meaning you can use it in non-playbin uses-cases. Note that you will still need to use streamsynchronizer to convert the outgoing gapless streams to a "continuous" time realm
  • urisourcebin handles parsing and buffering of parsed streams via the new parse-streams property (disabled by default, used when in uridecodebin3)
  • A single decodebin3 handles the various streams, reconfiguring the decoders if needed.

Other changes/improvements include:

  • Better buffering in urisourcebin due to dealing with parsed streams (If urisourcebin parse-streams == True non-default)
  • "Instantaneous" URI switching (if instant-uri = True, non-default). No need to go back to READY when switching URI, just set the new one with that property set and urisourcebin(s) will be flushed/prerolled/switched automatically. Re-uses existing decoders if compatible.
Edited by Edward Hervey

Merge request reports