mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
v4l2: allocator: Don't close foreign dmabuf
Imported dmabuf are not being duped, so they should never be closed. Instead, we ensure their live time by having strong reference on their original buffer. This should fix potential flickering due to dmabuf being closed too early. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5217>
This commit is contained in:
parent
df9482f39b
commit
426bf399d4
1 changed files with 1 additions and 3 deletions
|
@ -357,7 +357,6 @@ gst_v4l2_allocator_release (GstV4l2Allocator * allocator, GstV4l2Memory * mem)
|
|||
|
||||
switch (allocator->memory) {
|
||||
case V4L2_MEMORY_DMABUF:
|
||||
close (mem->dmafd);
|
||||
mem->dmafd = -1;
|
||||
break;
|
||||
case V4L2_MEMORY_USERPTR:
|
||||
|
@ -396,8 +395,7 @@ gst_v4l2_allocator_free (GstAllocator * gallocator, GstMemory * gmem)
|
|||
obj->munmap (mem->data, group->planes[mem->plane].length);
|
||||
}
|
||||
|
||||
/* This apply for both mmap with expbuf, and dmabuf imported memory */
|
||||
if (mem->dmafd >= 0)
|
||||
if (allocator->memory == V4L2_MEMORY_MMAP && mem->dmafd >= 0)
|
||||
close (mem->dmafd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue