After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794829 - dmabuf: adds new allocation function with flags.
dmabuf: adds new allocation function with flags.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-30 06:11 UTC by Hyunjun Ko
Modified: 2018-04-26 20:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags (3.61 KB, patch)
2018-03-30 06:48 UTC, Hyunjun Ko
none Details | Review
dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags (3.00 KB, patch)
2018-04-02 05:10 UTC, Hyunjun Ko
committed Details | Review

Description Hyunjun Ko 2018-03-30 06:11:48 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.
Comment 1 Hyunjun Ko 2018-03-30 06:43:38 UTC
In addition, this makes developers use dup function to duplicate the fd.
Comment 2 Hyunjun Ko 2018-03-30 06:48:18 UTC
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.
Comment 3 Nicolas Dufresne (ndufresne) 2018-03-30 12:28:44 UTC
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.
Comment 4 Hyunjun Ko 2018-04-02 05:10:50 UTC
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.
Comment 5 Nicolas Dufresne (ndufresne) 2018-04-02 13:41:27 UTC
Review of attachment 370429 [details] [review]:

Looks good to me, anyone have any comments, this is a new API ?
Comment 6 Nicolas Dufresne (ndufresne) 2018-04-26 20:41:31 UTC
Attachment 370429 [details] pushed as 56ab7e0 - dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags