Commit graph

2 commits

Author SHA1 Message Date
George Kiagiadakis
28194c0c11 waylandsink: replace the custom GstWlShmMemory with GstFdMemory 2015-10-14 22:05:51 +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