va: allocators fixes & improvements
va: allocator: add a memory pool object helper
Since both allocators use a memory pool, with its mutex and cond, this patch
refactors it into a single internal object, implementing a generic GstMemory
pool.
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.
va: allocator: broadcast when flushing
This patch handles when the bufferpool request a new buffer while
flushing.
Also fixes the usage of g_cond_wait(), which demands to be used
inside a loop to avoid spurious wakeups.
va: allocator: free allocator when a mem is held
An application, using for example appsink, can hold buffers from any
va allocator after setting the pipeline to NULL. We need to destroy
the allocator when that memory is unrefed.
This patch juggles a bit with the allocator reference count in
memories in order to achieve this:
1. When memory is created no alloc ref is modified
2. When memory is released, alloc ref is decreased
3. When memory is reassiged to a buffer, alloc ref is increased
4. When memory is flushed, alloc ref is increased becase it is going
to be decreased in gst_memory_unref()
Also this patch moves the deallocation of member variables to
finalize() rather than dispose()
va: allocator: dmabuf: initialize cond
Merge request reports
Activity
- Resolved by Víctor Manuel Jáquez Leal
- Resolved by Víctor Manuel Jáquez Leal
added 29 commits
-
8c82eb4d...33fcb0fa - 26 commits from branch
gstreamer:master
- 98231fc1 - va: allocator: free allocator when a mem is held
- 18cad83a - va: allocator: broadcast when flushing
- f22b8bf8 - va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
Toggle commit list-
8c82eb4d...33fcb0fa - 26 commits from branch
added 29 commits
-
8266b6d6...a801018e - 24 commits from branch
gstreamer:master
- 52d571d2 - va: allocator: dmabuf: initialize cond
- 08e79606 - va: allocator: free allocator when a mem is held
- 132b23a0 - va: allocator: broadcast when flushing
- 2ea6eb24 - va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
- 7cf5caa0 - va: allocator: add a memory pool object helper
Toggle commit list-
8266b6d6...a801018e - 24 commits from branch
- Resolved by Víctor Manuel Jáquez Leal
assigned to @gstreamer-merge-bot
mentioned in commit vjaquez/gst-plugins-bad@ba4442a2
mentioned in commit vjaquez/gst-plugins-bad@72ab56c3
mentioned in commit vjaquez/gst-plugins-bad@8fc50891
mentioned in commit vjaquez/gst-plugins-bad@8c128ead
mentioned in commit vjaquez/gst-plugins-bad@8e6ad826
added 5 commits
Toggle commit listmentioned in commit 734e2a74
changed milestone to %1.19.1
mentioned in commit fauxsoup1/gst-plugins-bad@4ccc475d
mentioned in commit fauxsoup1/gst-plugins-bad@f7472042
mentioned in commit fauxsoup1/gst-plugins-bad@0f0ea845
mentioned in commit fauxsoup1/gst-plugins-bad@ed817ecb
mentioned in commit fauxsoup1/gst-plugins-bad@8d70f749