From 9e3faf69f26e8c222c27a84fa4f758baa1c4a9b5 Mon Sep 17 00:00:00 2001 From: Mengkejiergeli Ba Date: Thu, 9 Mar 2023 17:18:16 +0800 Subject: [PATCH] msdkvpp: Pass null formats when create va allocator for RGB565 Fix https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1780 Part-of: --- subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c index 23f5640f37..0ad75d2c83 100644 --- a/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c +++ b/subprojects/gst-plugins-bad/sys/msdk/gstmsdkvpp.c @@ -446,8 +446,12 @@ gst_msdk_create_va_pool (GstVideoInfo * info, GstMsdkContext * msdk_context, if (use_dmabuf) allocator = gst_va_dmabuf_allocator_new (display); else { - formats = g_array_new (FALSE, FALSE, sizeof (GstVideoFormat)); - g_array_append_val (formats, GST_VIDEO_INFO_FORMAT (info)); + /* From attrib query, va surface format doesn't support RGB565, so leave + * the formats as NULL when creating va allocator for RGB565 */ + if (GST_VIDEO_INFO_FORMAT (info) != GST_VIDEO_FORMAT_RGB16) { + formats = g_array_new (FALSE, FALSE, sizeof (GstVideoFormat)); + g_array_append_val (formats, GST_VIDEO_INFO_FORMAT (info)); + } allocator = gst_va_allocator_new (display, formats); } if (!allocator) {