Commit graph

5 commits

Author SHA1 Message Date
Luis de Bethencourt
dc79b8d761 waylandsink: g_mkstemp is safer than mkstep 2015-03-03 16:53:32 +00:00
Luis de Bethencourt
bed7a679b5 Revert "waylandsink: mkstemp requires setting permission mask"
This reverts commit 1890e7355a.

Better to use g_mkstemp that takes care of the mask without affecting the
entire process.
2015-03-03 16:51:49 +00:00
Luis de Bethencourt
1890e7355a waylandsink: mkstemp requires setting permission mask
Using mkstemp without setting the permission mask is potentially harmful.
POSIX specification of mkstemp() does not say anything about file modes, so we
need to make sure its file mode creation mask is set appropriately before
calling it.
2015-03-03 15:51:55 +00:00
George Kiagiadakis
ee7968dd4a waylandsink: rename video format conversion functions to indicate they are about wl_shm
Needed to add linux_dmabuf format conversion functions later
2014-10-11 14:57:14 +02:00
George Kiagiadakis
d7bddb0c51 waylandsink: replace the custom buffer pool with an allocator
This reduces the complexity of having a custom buffer pool, as
we don't really need it. We only need the custom allocation part.
And since the wl_buffer is no longer saved in a GstMeta, we can
create it and add it on the buffers in the sink's render()
function, which removes the reference cycle caused by the pool
holding a reference to the display and also allows more generic
scenarios (the allocator being used in another pool, or buffers
being allocated without a pool [if anything stupid does that]).

This commit also simplifies the propose_allocation() function,
which doesn't really need to do all these complicated checks,
since there is always a correct buffer pool available, created
in set_caps().

The other side effect of this commit is that a new wl_shm_pool
is now created for every GstMemory, which means that we use
as much shm memory as we actually need and no more. Previously,
the created wl_shm_pool would allocate space for 15 buffers, no
matter if they were being used or not.
2014-10-11 14:57:13 +02:00