vp9parse: Correct the pts for frames inside a super frame.
authorHe Junyan <junyan.he@intel.com>
Tue, 11 Oct 2022 08:17:26 +0000 (16:17 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 13 Oct 2022 06:41:06 +0000 (06:41 +0000)
commiteac9c33cc117c0ff73cf0e241577ac7049b54a6c
treedd44cee47260072aa67f9b78aa4a7996345976a6
parent1e70525bc9dd0381481e3acc4898d8fdc470cc55
vp9parse: Correct the pts for frames inside a super frame.

When the alignment is "FRAME" and the parse is likely connecting to
a decoder, the current PTS setting for VP9 frames inside a super
frame is not very correct.

For example, the super frame may begin with non-displayed frames and
end with a displayed frame. The current way will assign the PTS to
the first non-displayed frame, which is a decode-only frame and the
PTS will be discarded in the video decoder. While the last displayed
frame has invalid PTS, and so the video decoder needs to guess its
PTS based on the frame rate and previous frame's PTS. This is not a
decent and robust way. And more important, when the previous frames
provide DTS, the video decoder will also guess the PTS based on the
previous frames' DTS and trigger the warning like:

  gstvideodecoder.c:3147:gst_video_decoder_prepare_finish_frame: \
  <vavp9dec0> decreasing timestame

It sets the reordered_output and makes the decoder in free run mode.

We should correct the PTS for a super frame, let the non-displayed
frames have no PTS while set the correct PTS to the displayed one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3155>
subprojects/gst-plugins-bad/gst/videoparsers/gstvp9parse.c