Skip to content

va: implement pooled allocators

This merge request supersedes !1596 (closed)

  1. Instead of shallow-copying va-surface-based memories, it allows them to be shareable.
  2. Implements pooled allocators either for GstVaAllocator and GstVaDmabufAllocator. This are based on a GstAtomicQueue where are pushed the disposed memories (instead of free them). Later, when GstVaPool calls acquire_buffer() it either allocate a new buffer or reuse a disposed memory in the queue.
  3. When reset_buffer() in GstVaPool the memories in buffer are removed (and disposed) so, basically, release_buffer() treats only with emptied buffers.
  4. start() in GstVaPool is nulled to avoid the removal of pre-allocated buffers, but also they aren't pre-allocated anymore, but on demand only.

So for, in my tests, H264 decoding works, but VP8 decode doesn't. AFAIU, allocators might need cond/wait between disposing and reusing memories or, we have to reallocate the buffes in bufferqueue start()

Cc: @seungha.yang, @ndufresne, @He_Junyan

Edited by Víctor Manuel Jáquez Leal

Merge request reports

Loading