h265decoder: Drain decoder on new_sequence()
authorSeungha Yang <seungha@centricular.com>
Fri, 11 Mar 2022 19:45:22 +0000 (04:45 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 15 Mar 2022 21:08:06 +0000 (21:08 +0000)
commit3e49ff0ff585f8512fe7c45710ceb729682d409b
treef60217805c335c2ce534859bbd28835489fdf176
parent9494509ee02d0df69da889a00fcfd0bea3916bf6
h265decoder: Drain decoder on new_sequence()

Holding previously decoded but not outputted pictures even after
new_sequence is not a safe approach in various aspect.
However, we cannot drain out DPB on new_sequence() unconditionally,
because there is a case where decoder should drop decoded pictures
if NoOutputOfPriorPicsFlag is set.

To detect NoOutputOfPriorPicsFlag before the new_sequence() call,
this patch splits decoding process into two path, one for nal unit parsing
in order to detect NoOutputOfPriorPicsFlag and then each nal unit
will be decoded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1937>
subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c
subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h