From 0649b0ab0f4693088e68ad52dec7847ff4864c70 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 13 Jul 2018 14:41:13 -0400 Subject: [PATCH] v4l2allocator: Fix userptr importation The length passed to the driver was always 0 instead of the size of the memory. This would fail validation in videobuf2. --- sys/v4l2/gstv4l2allocator.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c index 34a581bcfc..7e0e7c260d 100644 --- a/sys/v4l2/gstv4l2allocator.c +++ b/sys/v4l2/gstv4l2allocator.c @@ -1149,13 +1149,11 @@ gst_v4l2_allocator_import_userptr (GstV4l2Allocator * allocator, for (i = 0; i < group->n_mem; i++) { gsize maxsize, psize; - if (V4L2_TYPE_IS_MULTIPLANAR (obj->type)) { - maxsize = group->planes[i].length; - psize = size[i]; - } else { - maxsize = group->planes[i].length; - psize = img_size; - } + /* TODO request used size and maxsize seperatly */ + if (V4L2_TYPE_IS_MULTIPLANAR (obj->type)) + maxsize = psize = size[i]; + else + maxsize = psize = img_size; g_assert (psize <= img_size);