• Alexandre Courbot's avatar
    media/gpu/v4l2: add queue management classes · 660e3c77
    Alexandre Courbot authored
    Add the V4L2Queue class, that manages buffers allocations and queuing.
    Users of this class don't have to manage the set of free buffers
    themselves, which will help factorizing a considerable amount of code
    and reduce the potential for bugs.
    
    Users of V4L2Queue can obtain a unique reference to a free buffer that
    they can prepare and queue. Dequeued buffers come in the form of a
    refcounted buffer instance, which puts the V4L2 buffer back into the
    list of free buffer as it is destroyed. This greatly simplifies V4L2
    buffers lifecycle, which is now managed by short functions which
    invariants can be precisely enforced.
    
    BUG=792790
    TEST=Make sure VDA test was compiling and running
    
    Change-Id: I7b4724fbc444c4cd8ed077617a1aaadcbe4c8011
    Reviewed-on: https://chromium-review.googlesource.com/1170706
    Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
    Reviewed-by: default avatarPawel Osciak <posciak@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#595014}
    660e3c77
v4l2_device.cc 43.4 KB