gstreamer/libs/gst
Thibault Saunier 39b9cc554c basesink: Fix clock synchronization running time in reverse playback
In reverse playback, buffers have to be displayed at buffer.stop running
time, otherwise a same set of buffer can't be displayed in the exact opposite
order to forward playback.

For example, seeking a video stream at 1fps with start=0, stop=5s, rate=1.0

will display the following buffers:

  b0.pts = 0s, b0.duration = 1s - at running time = 0s
  b1.pts = 1s, b1.duration = 1s - at running time = 1s
  b2.pts = 2s, b2.duration = 1s - at running time = 2s
  b3.pts = 3s, b3.duration = 1s - at running time = 3s
  b4.pts = 4s, b4.duration = 1s - at running time = 4s
  <wait at EOS for 1second>

Now, playing that reverse with start=0, stop=5s, rate=1.0 has to display
the following buffers:

  b0.pts = 4s, b0.duration = 1s - at running time = 0s
  b1.pts = 3s, b1.duration = 1s - at running time = 1s
  b2.pts = 2s, b2.duration = 1s - at running time = 2s
  b3.pts = 1s, b3.duration = 1s - at running time = 3s
  b4.pts = 0s, b4.duration = 1s - at running time = 4s
  <wait at EOS for 1second>

With the previous code, it reproduced the following:

  b0.pts = 4s, b0.duration = 1s - at running time = 1s
  b1.pts = 3s, b1.duration = 1s - at running time = 2s
  b2.pts = 2s, b2.duration = 1s - at running time = 3s
  b3.pts = 1s, b3.duration = 1s - at running time = 4s
  b4.pts = 0s, b4.duration = 1s - at running time = 5s
  <NO WAIT AT EOS AND POST EOS RIGHT AWAY>

This is being tested with the `validate.launch_pipeline.sink.reverse_playback_clock_waits.*`
set of tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/450>
2020-05-06 14:24:36 +00:00
..
base basesink: Fix clock synchronization running time in reverse playback 2020-05-06 14:24:36 +00:00
check Add missing colons to Since markers in the docs 2020-05-01 10:07:09 +03:00
controller Remove autotools build system 2019-10-13 16:10:42 +01:00
helpers Remove autotools build system 2019-10-13 16:10:42 +01:00
net gstreamer: use of g_value_dup_string 2019-12-18 15:57:54 +01:00
meson.build meson: Always use a dependency object for dependencies 2018-09-05 16:33:43 +05:30