kmsallocator: Update GstVideoInfo.size when extrapolating
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 5 Oct 2017 19:46:20 +0000 (15:46 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 5 Oct 2017 20:19:15 +0000 (16:19 -0400)
When we guess the strides, we need to also update the GstVideoInfo.size
otherwise the memory size will be set to something smaller then needed.
This was causing crash with the DMABuf exportation, since we would not
mmap() a large enough buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=787593

sys/kms/gstkmsallocator.c

index dd5f230..4118e17 100644 (file)
@@ -213,6 +213,9 @@ gst_kms_allocator_memory_create (GstKMSAllocator * allocator,
         GST_VIDEO_INFO_PLANE_OFFSET (vinfo, i));
   }
 
+  /* Update with the size use for display, excluding any padding at the end */
+  GST_VIDEO_INFO_SIZE (vinfo) = offs;
+
 done:
   kmsmem->bo->handle = arg.handle;
   /* will be used a memory maxsize */