Caps may change the framerate used and the frame counting approach for
timestamps, needs to account for this by taking a snapshot of the current frames
and running time to add to all subsequent produced frames. Code is mostly taken
from videotestsrc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9455>