• Chih-Yu Huang's avatar
    media/gpu/chromeos: Refactor ImageProcessor. · 205bf627
    Chih-Yu Huang authored
    In general, image format conversion is time-consuming task.
    ImageProcessor, the interface for image conversion, should offload the
    conversion tasks to a different thread to avoid occupying the working
    thread for long time. Originally, thread hopping is handled by each
    implementation. It makes implementations complicated and error-prone.
    
    In this CL, we refactor the structure of ImageProcessor. We add a new
    interface "ImageProcessorBackend". Each implementation change to
    inherit this interface. The interface only works on backend sequence.
    ImageProcessor becomes a concrete class instead of a interface. It
    has a ImageProcessorBackend instance, and is in charge of handling
    sequence hopping between client sequence and backend sequence.
    ImageProcessor also guarantees to call or destroy the client's
    callback on the client sequence.
    
    Bug: 1028889
    Test: run vda_tests on kukui and hana
    Test: build media/gpu/{chromeos,vaapi,v4l2}
    
    Change-Id: I0f7774bc62adc7d4b4adf68ab33d95d9013656be
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1942600
    Commit-Queue: Chih-Yu Huang <akahuang@chromium.org>
    Reviewed-by: default avatarAlexandre Courbot <acourbot@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#725476}
    205bf627
vaapi_image_processor.h 1.9 KB