va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 17 Nov 2020 13:53:05 +0000 (14:53 +0100)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 24 Nov 2020 11:44:24 +0000 (12:44 +0100)
commit8c128ead6ddbb750da48ce85c1552ea78c5017e6
treeec8dc6dd5aa197a7468eb1a201e5c9313689fd9c
parent8fc50891b11829e2efd8ac22c2ecc62e46f98252
va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT

In order to honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT in VA pool, allocators'
wait_for_memory() has to be decoupled from their prepare_buffer() so it could be
called in pools' acquire_buffer() if the flag is not set.

wait_for_memory() functions are blocking so the received memories are assigned
to the fist requested buffer, if multithreaded calls. For this a new mutex were
added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1815>
sys/va/gstvaallocator.c
sys/va/gstvaallocator.h
sys/va/gstvapool.c