vaapipostproc: use sink resolution to calculate src colorimetry
authorU. Artie Eoff <ullysses.a.eoff@intel.com>
Tue, 4 Feb 2020 22:17:43 +0000 (14:17 -0800)
committerU. Artie Eoff <ullysses.a.eoff@intel.com>
Wed, 5 Feb 2020 18:33:23 +0000 (10:33 -0800)
commit2b6fa1966570b161008565a294bce863dbbd3ab7
tree6d18039f72120d6e77719347a4602d02cb9d156d
parentc6d8ee737f01f897940d79528b0452d117c26e24
vaapipostproc: use sink resolution to calculate src colorimetry

The default output colorimetry is persuaded by the output
resolution, which is too naive when doing VPP cropping
and/or scaling.  For example, scaling 4K(sink)->1080P(src)
resolution (i.e. both YUV) results in bt2020(sink)->bt709(src)
colorimetry selection and some drivers don't support that
mode in vpp.

Thus, if output (i.e. downstream) does not specify a
colorimetry then we use the input resolution instead of the
output resolution to create the default colorimetry.  Also,
note that we still use the output format since it may be a
different color space than the input.  As in the example
above, this will result in bt2020(sink)->bt2020(src)
colorimetry selection and all drivers (afaik) should support
that in vpp.
gst/vaapi/gstvaapipostprocutil.c