From f987cd8df9222e4aca695e9057d9b92b281ea62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 31 Mar 2021 11:13:52 +0200 Subject: [PATCH] va: caps: Add image formats in raw caps only for non-iHD. This plugin, for decoders more concretely, assumes that a VA config can do certain color conversions when mapping frames onto CPU's memory. This assumption was valid for i965 and Gallium drivers which generates valid outputs in bitstreams testers (v.gr. fluster). Nonetheless, iHD, even when it generates acceptable rendered frames, output's MD5 of tests weren't valid. This patch append the image formats, for color conversion when mapping to memory, for non-iHD drivers. Part-of: --- sys/va/gstvacaps.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/va/gstvacaps.c b/sys/va/gstvacaps.c index 9a4ccb4ee2..e421c812bb 100644 --- a/sys/va/gstvacaps.c +++ b/sys/va/gstvacaps.c @@ -222,11 +222,19 @@ gst_va_create_raw_caps_from_config (GstVaDisplay * display, VAConfigID config) } /* raw caps */ /* XXX(victor): assumption -- drivers can only download to image - * formats with same chroma of surface's format + * formats with same chroma of surface's format. + * + * This assumption is only valid for i965 and Gallium (so far). + * iHD's color space conversor, in decoders, has some problems or + * outputs wrong MD5 in tests. */ { GstCaps *raw_caps; - GArray *image_formats = gst_va_display_get_image_formats (display); + GArray *image_formats = NULL; + + if (!gst_va_display_is_implementation (display, + GST_VA_IMPLEMENTATION_INTEL_IHD)) + image_formats = gst_va_display_get_image_formats (display); if (!image_formats) { raw_caps = gst_caps_copy (base_caps);