waylandsink: replace the custom buffer pool with an allocator
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Mon, 23 Jun 2014 13:40:02 +0000 (16:40 +0300)
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>
Sat, 11 Oct 2014 12:57:13 +0000 (14:57 +0200)
commitd7bddb0c51db0b44da7b377d36d235d5cf8ba5ed
tree424039741de98baaef093b3fcd97716b38db6938
parent9807d58b01cca8b71e5fe2908bafb0a3e80b7059
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.
ext/wayland/Makefile.am
ext/wayland/gstwaylandsink.c
ext/wayland/waylandpool.c [deleted file]
ext/wayland/waylandpool.h [deleted file]
ext/wayland/wlshmallocator.c [new file with mode: 0644]
ext/wayland/wlshmallocator.h [new file with mode: 0644]