From 90af9b77045b80d2fcf17a3c192828a699308236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 30 Nov 2023 12:00:27 +0100 Subject: [PATCH] vaallocator: don't fail if drm fourcc are different When exporting a DMABuf from a VASurface the user might tell that the surface was allocated with certain fourcc, but the returned VADRMPRIMESurfaceDescriptor migth tell a different fourcc, as in the case or radeonsi driver, for duplicated fourcc, such as YUY2 and YUYV. Originally it was supposed to be a failed exportation. This patch relax this validation by allowing different fourcc. Part-of: --- .../gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c index 3030a9ef03..d391b569a2 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/va/gstvaallocator.c @@ -586,10 +586,13 @@ _va_create_surface_and_export_to_dmabuf (GstVaDisplay * display, if (GST_VIDEO_INFO_N_PLANES (info) != desc.num_layers) goto failed; + /* YUY2 and YUYV are the same. radeonsi returns always YUYV. + * There's no reason to fail if the different fourcc if there're dups. + * https://fourcc.org/pixel-format/yuv-yuy2/ */ if (fourcc != desc.fourcc) { - GST_ERROR ("Unsupported fourcc: %" GST_FOURCC_FORMAT, + GST_INFO ("Different fourcc: requested %" GST_FOURCC_FORMAT " - returned %" + GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc), GST_FOURCC_ARGS (desc.fourcc)); - goto failed; } if (desc.num_objects == 0) {