h264parse: fix timestamping of interlaced fields in output
authorMathieu Duponchelle <mathieu@centricular.com>
Fri, 22 Jan 2021 02:26:29 +0000 (03:26 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Tue, 16 Feb 2021 16:15:27 +0000 (17:15 +0100)
commit8ae56d60a3e176b8b11a62526fcc479551250077
tree70cc9054da207dad779e043742608cd770b56c12
parent5006d9120806a510f5b48d24b9b04ee54824121c
h264parse: fix timestamping of interlaced fields in output

Instead of relying on GstBaseParse default behaviour of computing
the duration of a parsed buffer based on the framerate passed
to gst_base_parse_set_framerate(), we instead compute the duration
ourselves, as we have more information available.

In particular, this means we now output buffers with a duration
that matches that of raw interlaced buffers when each field is
output in a separate buffer.

This fixes DTS interpolation performed by GstBaseParse, as the
previous behaviour of outputting each field with the duration of
a full frame was messing up the base class calculations.

When not enough information is available, h264parse simply falls
back to calculating the duration based on the framerate and hope
for the best as was the case previously.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1973>
gst/videoparsers/gsth264parse.c