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.
https://bugzilla.gnome.org/show_bug.cgi?id=794829
When doing CPU Access, some architecture may require caches to be
synchronize before use. Otherwise, some visual artifact may be
visible, as the CPU modification may still resides in cache.
https://bugzilla.gnome.org/show_bug.cgi?id=794216
Make a base class that can help with allocating fd-backed memory.
Make dmabuf extend from the base class.
We can now make methods to check if memory has an fd and get the fd for
all the different types of fd-backed memory.
Make a separate file for the code to handle the fd backed memory.
This would make it possible later to add other allocators also using
fd backed memory.
Fixes regression introduced by:
commit b60888fd4b
Author: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue May 20 11:18:56 2014 +0200
dmabuf: share the mapping with shared copies of the memory
https://bugzilla.gnome.org/show_bug.cgi?id=730441
A simple '&' is not sufficiant. With mmapping_flags == PROT_READ and
prot == PROT_READ|PROT_WRITE the check produces the wrong result.
Change the check to make sure that prot is a subset of mmapping_flags.
https://bugzilla.gnome.org/show_bug.cgi?id=730559
With lots of shared memory instances (e.g. created by a RTP payloader) the
overhead of duplicating the file descriptor and creating extra mappings is
significant. To avoid this, the parent memory maps the whole region and the
shared copies just reuse the same mapping.
https://bugzilla.gnome.org/show_bug.cgi?id=730441
Makes it easier to track how many users there are
Also make it possible to create a dmabuf struct on systems without mmap,
it just won't be possible to map it.
https://bugzilla.gnome.org/show_bug.cgi?id=707793
A successful gst_dmabuf_mem_map must always increment the mmap count.
Otherwise the first gst_dmabuf_mem_unmap will unmap the memory and all
other user will access unmapped memory.
https://bugzilla.gnome.org/show_bug.cgi?id=706680
In decide_allocation function some element may when to test the proposed allocator.
For example like this:
if (gst_query_get_n_allocation_params (query) > 0) {
GstAllocator * allocator;
GstAllocationParams params;
gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms);
if (g_strcmp0(allocator->mem_type, GST_ALLOCATOR_DMABUF) == 0)
GST_DEBUG("got dmabuf allocator");
else
GST_DEBUG("got an other allocator");
}
https://bugzilla.gnome.org/show_bug.cgi?id=703659
Create new GstMemory and GstAllocator base on dmabuf.
Memory is not allocated/freed by userland but mapped/unmmaped
from a dmabuf file descriptor when requested.
This allocator is included in a new lib called libgstallocators
https://bugzilla.gnome.org/show_bug.cgi?id=693826