GNOME Bugzilla – Bug 794829
dmabuf: adds new allocation function with flags.
Last modified: 2018-04-26 20:42:04 UTC
There are some use cases to be needed to set GST_FD_MEMORY_FLAG_DONT_CLOSE since I can handle the lifetime of the fd when using dmabuf memory. But currently gstdmabuf memory doesn't provide an interface to do it while fd memory already provide. So I would propose this patch.
In addition, this makes developers use dup function to duplicate the fd.
Created attachment 370326 [details] [review] dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags If we can guarantee the lifetime of the fd is longer than the memory, we can use DONT_CLOSE flag not to close when release. But it's not provided in gstdmabuf yet while gstfdmemory does. For example, in case of using VA-API or MSDK, we would need this api. Otherwise we should call dup to duplicate the fd.
Review of attachment 370326 [details] [review]: Just one nitpick, I would not duplicate the enum. The new function is clearly a redirect, I suggested it because I believe it will be less confusing when reading code, and if we later find something missing in the GstFDMemory structure, we can override.
Created attachment 370429 [details] [review] dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags If we can guarantee the lifetime of the fd is longer than the memory, we can use DONT_CLOSE flag not to close when release. But it's not provided in gstdmabuf yet while gstfdmemory does. For example, in case of using VA-API or MSDK, we would need this api. Otherwise we should call dup to duplicate the fd.
Review of attachment 370429 [details] [review]: Looks good to me, anyone have any comments, this is a new API ?
Attachment 370429 [details] pushed as 56ab7e0 - dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags