There are often only two buffers queued in the kernel so no new buffers are
requested.
With every qbuf, the kernel receives a new DMABUF for the specified index.
This most likely differs from the last DMABUF and the old cached entry is
released. This results in a lot of map/unmap overhead if the kernel driver
needs a mapping for the buffer.
With a larger queue, it's quite likely, that both old and new DMABUFs are
also mapped for another index. So the map/unmap is skipped, because the
mapping is reference counted.
The corresponding allocated buffers don't contain any actual memory, so
allocating them is quite cheep. So the log message is updated to clarify
this.
can_allocate = GST_V4L2_ALLOCATOR_CAN_ALLOCATE (pool->vallocator, DMABUF);
- GST_DEBUG_OBJECT (pool, "requesting %d DMABUF buffers", min_buffers);
+ GST_DEBUG_OBJECT (pool, "requesting %d DMABUF import slots", max_buffers);
- count = gst_v4l2_allocator_start (pool->vallocator, min_buffers,
+ count = gst_v4l2_allocator_start (pool->vallocator, max_buffers,
V4L2_MEMORY_DMABUF);
/* There is no rational to not get what we asked */