va: vpp: Update the colorimetry and HDR fields when fixup src caps.
authorHe Junyan <junyan.he@intel.com>
Wed, 20 Apr 2022 05:18:34 +0000 (13:18 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 22 Apr 2022 06:53:37 +0000 (06:53 +0000)
commit43dfe021daed44c14753e6b559340940b0f0e6ee
tree2a3745a3a9787048c45495953690bb50a5c09c0e
parent4de4aa10106d1e7ab21b8a89e764e3a1523d20fe
va: vpp: Update the colorimetry and HDR fields when fixup src caps.

When we fixup src caps, the current way of handling the HDR fields is not
correct.
1. We trim the HDR fields only when the input caps is not a subset of the
fixup src caps. But in fact, the input caps with HDR fields such as the
"mastering-display-info" can possibly be the subset of the fixup src caps,
if they have all same other fields.
2. We always copy the colorimetry from input caps to src caps if it is
absent. But when hdr-tone-mapping is enabled, the HDR->SDR conversion makes
the colorimetry change. We should use downstream's setting, or just use the
default colorimetry of SDR.

We changes to:
1. If hdr-tone-mapping is enabled, we trim all HDR fields and add a correct
colorimetry.
2. Copy colorimetry from input if it is still absent.
3. Consider the subset replacement.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2244>
subprojects/gst-plugins-bad/sys/va/gstvavpp.c