From f392e9b369ab5e893e99e8f9f668c33374624a9e Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Tue, 16 Jul 2024 23:08:39 +0200 Subject: [PATCH] vabase: Stop aligning VideoInfo during DMABUF import Doing so resets the stride from the VideoMeta and it wasn't done before the commit below. While on it, drop the plane size check as we can't reliably predict the correct size when using DRM modifiers. Fixes: 89b0a6fa23 ("va: refactor buffer import") Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvabase.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabase.c b/subprojects/gst-plugins-bad/sys/va/gstvabase.c index 4e74405a9c..dbc1a19cdb 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabase.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabase.c @@ -44,8 +44,6 @@ _try_import_dmabuf_unlocked (GstVaBufferImporter * importer, GstBuffer * inbuf) guint i, n_planes, usage_hint; gsize offset[GST_VIDEO_MAX_PLANES]; uintptr_t fd[GST_VIDEO_MAX_PLANES]; - gsize plane_size[GST_VIDEO_MAX_PLANES]; - GstVideoAlignment align = { 0, }; /* This will eliminate most non-dmabuf out there */ if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (inbuf, 0))) @@ -68,9 +66,6 @@ _try_import_dmabuf_unlocked (GstVaBufferImporter * importer, GstBuffer * inbuf) } } - if (!gst_video_info_align_full (&drm_info.vinfo, &align, plane_size)) - return FALSE; - /* Find and validate all memories */ for (i = 0; i < n_planes; i++) { guint length; @@ -78,8 +73,8 @@ _try_import_dmabuf_unlocked (GstVaBufferImporter * importer, GstBuffer * inbuf) gsize mem_skip; if (!gst_buffer_find_memory (inbuf, - GST_VIDEO_INFO_PLANE_OFFSET (&drm_info.vinfo, i), plane_size[i], - &mem_idx, &length, &mem_skip)) + GST_VIDEO_INFO_PLANE_OFFSET (&drm_info.vinfo, i), 1, &mem_idx, + &length, &mem_skip)) return FALSE; /* We can't have more then one dmabuf per plane */