msdkvpp: Pass null formats when create va allocator for RGB565

Fix https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1780

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4136>
This commit is contained in:
Mengkejiergeli Ba 2023-03-09 17:18:16 +08:00 committed by Haihao Xiang
parent a99fc193e5
commit 9e3faf69f2

View file

@ -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) {