videorate: Fix changing `rate` property during playback
authorThibault Saunier <tsaunier@igalia.com>
Sun, 31 May 2020 04:27:14 +0000 (00:27 -0400)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 1 Jun 2020 07:07:31 +0000 (07:07 +0000)
commit6499e2afa53ad0e12c2d9382f55917e6c55bca21
tree1028e2f4ee7afce2dcb7885296b71c42e84aa688
parentd846a1ac1ce59465534049e29dd16d5926746876
videorate: Fix changing `rate` property during playback

We need to take into account the base_ts to compute next_ts and it needs
to be updated on rate change.

This introduces `pending_rate` so that change rate is properly handled
in the streaming thread in a safe way.

Added tests

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/679>
gst/videorate/gstvideorate.c
gst/videorate/gstvideorate.h
tests/validate/meson.build
tests/validate/videorate/change_rate_reverse_playback.validatetest [new file with mode: 0644]
tests/validate/videorate/change_rate_reverse_playback/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/change_rate_reverse_playback/flow-expectations/log-videorate-src-expected [new file with mode: 0644]
tests/validate/videorate/change_rate_while_playing.validatetest [new file with mode: 0644]
tests/validate/videorate/change_rate_while_playing/flow-expectations/log-videorate-sink-expected [new file with mode: 0644]
tests/validate/videorate/change_rate_while_playing/flow-expectations/log-videorate-src-expected [new file with mode: 0644]