mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-23 23:58:17 +00:00
v4l2bufferpool: request the maximum number of buffers for DMABUF
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.
This commit is contained in:
parent
00539e1277
commit
94e323c10f
1 changed files with 2 additions and 2 deletions
|
@ -841,9 +841,9 @@ gst_v4l2_buffer_pool_start (GstBufferPool * bpool)
|
||||||
|
|
||||||
can_allocate = GST_V4L2_ALLOCATOR_CAN_ALLOCATE (pool->vallocator, DMABUF);
|
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);
|
V4L2_MEMORY_DMABUF);
|
||||||
|
|
||||||
/* There is no rational to not get what we asked */
|
/* There is no rational to not get what we asked */
|
||||||
|
|
Loading…
Reference in a new issue