Skip to content
Snippets Groups Projects

va: allocators fixes & improvements

All threads resolved!
    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
Edited by Víctor Manuel Jáquez Leal

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 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

    Compare with previous version

  • added 3 commits

    • 7dd419e3 - va: allocator: free allocator when a mem is held
    • c8e4fda2 - va: allocator: broadcast when flushing
    • 8266b6d6 - va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT

    Compare with previous version

  • 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

    Compare with previous version

  • Víctor Manuel Jáquez Leal changed the description

    changed the description

  • resolved all threads

  • Víctor Manuel Jáquez Leal changed title from va: allocators improvements to va: allocators fixes & improvements

    changed title from va: allocators improvements to va: allocators fixes & improvements

  • He Junyan
  • resolved all threads

  • resolved all threads

  • added 5 commits

    • ba4442a2 - va: allocator: dmabuf: initialize cond
    • 72ab56c3 - va: allocator: free allocator when a mem is held
    • 8fc50891 - va: allocator: broadcast when flushing
    • 8c128ead - va: pool, allocator: honor GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT
    • 8e6ad826 - va: allocator: add a memory pool object helper

    Compare with previous version

  • mentioned in commit 734e2a74

  • changed milestone to %1.19.1

  • Please register or sign in to reply
    Loading