• Andres Calderon Jaramillo's avatar
    VAAPI-JDA: Extract VideoFrame-independent code into VaapiJpegDecoder. · 769defd0
    Andres Calderon Jaramillo authored
    This CL takes VideoFrame-independent code from
    VaapiJpegDecodeAccelerator's DecodeTask() and OutputPicture() methods
    and puts it in VaapiJpegDecoder::DoDecode(). The idea is for
    VaapiJpegDecoder to be responsible for dealing with the VaapiWrapper, so
    now part of the initialization of the VaapiJpegDecodeAccelerator is
    delegated to VaapiJpegDecoder.
    
    Now, VaapiJpegDecoder::DoDecode() will take encoded data. It will do the
    parsing, VAAPI buffer submission, decode execution, and VAImage
    extraction. It will then return the decoded output as a ScopedVAImage.
    The intent is to have a VaapiJpegDecoder member in two classes:
    VaapiJpegDecodeAccelerator (existing) and the eventual implementation of
    gpu::ImageDecodeAcceleratorWorker. In the first case, we use the
    ScopedVAImage to copy the decoded data into a VideoFrame. In the second
    case, we use it to copy the decoded data into a vector.
    
    The unit tests are modified accordingly. Additionally,
    ::testing::FLAGS_gtest_death_test_style = "threadsafe" is added to two
    of the tests due to safety issues when using EXPECT_DCHECK_DEATH when
    there are multiple threads.
    
    The reason for introducing the grayscale image is that before, the
    DecodeFail test case was using a normal image and poking at the results
    of the JPEG parsing so that it failed. Now, the decoder interface
    doesn't take a JpegParseResult, so we can't do the same poking. Instead,
    we give it a real unsupported image.
    
    Bug: 924310
    Test: jpeg_decode_accelerator_unittest passes on nocturne and grunt.
    Change-Id: I52d9760d233e63b2831408f60309803984784903
    Reviewed-on: https://chromium-review.googlesource.com/c/1427457
    Commit-Queue: Andres Calderon Jaramillo <andrescj@chromium.org>
    Auto-Submit: 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@{#634298}
    769defd0
vaapi_jpeg_decoder.cc 14.9 KB