msdkvpp: Fix frc from lower fps to higher fps
authorMengkejiergeli Ba <mengkejiergeli.ba@intel.com>
Tue, 20 Jul 2021 10:15:11 +0000 (18:15 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 18 Aug 2021 03:06:59 +0000 (03:06 +0000)
commit86872b1b46ea2d861006b0f2048ee27f948c4f34
tree898b56d862c91a301bbd390c5ca3c1a0a057ebb5
parent18314764fc53a0267935472e2e505f7b04139b31
msdkvpp: Fix frc from lower fps to higher fps

There are three framerate conversion algorithms described in
<https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md>,
interpolation is not implemented so far and thus distributed timestamp algorihtm
is considered to be more practical which evenly distributes output timestamps
according to output framerate. In this case, newly generated frames are inserted
between current frame and previous one, timestamp is calculated by msdk API.

This implementation first pushes newly generated buffers(outbuf_new) forward and
the current buffer(outbuf) is handled at last round by base transform automatically.
A flag "create_new_surface" is used to indicate if new surfaces have been generated
and then push new outbuf forward accordingly.

Considering the upstream element may not be the msdk element, it is necessary to
always set the input surface timestamp as same as input buffer's timestamp and
convert it to msdk timestamp.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2418>
sys/msdk/gstmsdkvpp.c