va: caps: bail raw caps if driver doesn't report surface formats

This is a bug in Gallium RadeonSI driver for Polaris10, which doesn't
report sufrace formats for reported chroma.

If one chroma doesn't report surface formats, skip the generated caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1483>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-08-01 21:59:30 +02:00 committed by GStreamer Merge Bot
parent d3ef3d562a
commit 5154ee7f4c

View file

@ -186,6 +186,13 @@ gst_va_create_raw_caps_from_config (GstVaDisplay * display, VAConfigID config)
}
}
/* if driver doesn't report surface formats for current
* chroma. Gallium AMD bug for 4:2:2 */
if (formats->len == 0) {
caps = NULL;
goto bail;
}
base_caps = gst_caps_new_simple ("video/x-raw", "width", GST_TYPE_INT_RANGE,
min_width, max_width, "height", GST_TYPE_INT_RANGE, min_height,
max_height, NULL);
@ -256,6 +263,8 @@ gst_va_create_raw_caps_from_config (GstVaDisplay * display, VAConfigID config)
}
gst_caps_unref (base_caps);
bail:
g_array_unref (formats);
g_free (attribs);