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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7187>
This commit is contained in:
Robert Mader 2024-07-16 23:08:39 +02:00 committed by GStreamer Marge Bot
parent b30a83ed5a
commit f392e9b369

View file

@ -44,8 +44,6 @@ _try_import_dmabuf_unlocked (GstVaBufferImporter * importer, GstBuffer * inbuf)
guint i, n_planes, usage_hint; guint i, n_planes, usage_hint;
gsize offset[GST_VIDEO_MAX_PLANES]; gsize offset[GST_VIDEO_MAX_PLANES];
uintptr_t fd[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 */ /* This will eliminate most non-dmabuf out there */
if (!gst_is_dmabuf_memory (gst_buffer_peek_memory (inbuf, 0))) 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 */ /* Find and validate all memories */
for (i = 0; i < n_planes; i++) { for (i = 0; i < n_planes; i++) {
guint length; guint length;
@ -78,8 +73,8 @@ _try_import_dmabuf_unlocked (GstVaBufferImporter * importer, GstBuffer * inbuf)
gsize mem_skip; gsize mem_skip;
if (!gst_buffer_find_memory (inbuf, if (!gst_buffer_find_memory (inbuf,
GST_VIDEO_INFO_PLANE_OFFSET (&drm_info.vinfo, i), plane_size[i], GST_VIDEO_INFO_PLANE_OFFSET (&drm_info.vinfo, i), 1, &mem_idx,
&mem_idx, &length, &mem_skip)) &length, &mem_skip))
return FALSE; return FALSE;
/* We can't have more then one dmabuf per plane */ /* We can't have more then one dmabuf per plane */