mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
v4l2: free kernel buffers before allocating new ones
See https://bugzilla.gnome.org/show_bug.cgi?id=670257
This commit is contained in:
parent
9fd4af2164
commit
1b09bc609a
1 changed files with 11 additions and 0 deletions
|
@ -305,6 +305,17 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
|
|||
else
|
||||
num_buffers = max_buffers;
|
||||
|
||||
/* Free the buffers from the kernel */
|
||||
GST_DEBUG_OBJECT (pool, "Freeing the buffers from the kernel");
|
||||
|
||||
memset (&breq, 0, sizeof (struct v4l2_requestbuffers));
|
||||
breq.type = obj->type;
|
||||
breq.count = 0;
|
||||
breq.memory = V4L2_MEMORY_MMAP;
|
||||
|
||||
if (v4l2_ioctl (pool->video_fd, VIDIOC_REQBUFS, &breq) < 0)
|
||||
goto reqbufs_failed;
|
||||
|
||||
/* first, lets request buffers, and see how many we can get: */
|
||||
GST_DEBUG_OBJECT (pool, "starting, requesting %d MMAP buffers",
|
||||
num_buffers);
|
||||
|
|
Loading…
Reference in a new issue