• Andres Calderon Jaramillo's avatar
    media: Make the VaapiJpegDecodeAcceleratorWorker output the result. · e3e9a8c1
    Andres Calderon Jaramillo authored
    This CL makes the VaapiJpegDecodeAcceleratorWorker extract the result of
    a JPEG decode as a DmaBuf and return it to whoever requested the decode.
    
    Currently, the visible size of an image is not readily available when
    the result of a decode is exported as a NativePixmapDmaBuf. Therefore,
    most of this CL plumbs this visible size because it's needed so that it
    can be returned to the rest of the rendering pipeline after an image is
    decoded.
    
    The plumbing consists in keeping track of the visible size inside the
    ScopedVASurface that refers to the decode result. This is then used when
    either 1) exporting the surface as a NativePixmapDmaBuf, and
    2) extracting a VAImage out of the surface.
    
    The JPEG decoder unit tests are correspondingly adapted so that odd
    images are only tested when exporting decodes as DmaBufs. This is
    because odd images are only expected in this path (as opposed to the
    camera capture path which may use VAImages, and odd sizes seem to
    misbehave in that case).
    
    Test: tests for the worker are added in media_unittests.
    Bug: 868400
    Change-Id: Icb78d9c7f5b3c9213e36c885cf9ff16480d1c545
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1657568
    Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
    Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
    Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#681175}
    e3e9a8c1
vaapi_wrapper.cc 77.5 KB