• Alexandre Courbot's avatar
    media/gpu/v4l2: Use NativePixmapHandle to create GL/EGL images · 9a075af9
    Alexandre Courbot authored
    We used to pass a vector of DMABuf FDs to the GL/EGL image creation
    functions. This was very error-prone, as these vectors could contain
    less FDs than there were planes in the buffer, and this information
    was used to signal that the last FD contained several planes. The
    function receiving these incomplete FDs would then try to figure out the
    actual planes layout, with more or less luck, often introducing bugs in
    the way.
    
    Solve this issue once and for all by passing all importable buffer
    information within the VDAs through NativePixmapHandles: they always
    contain as many FDs as there are planes, and also have detailed layout
    information. On top of that, they are what we receive when using import
    mode (which means we can pass the exact layout information down to
    GL/EGL), and we already have a function that creates them from a
    VideoFrame. This helps reduce the amount of code, all the while making
    it safer and more readable.
    
    BUG=b:146842214
    TEST=VDAtest passes on Hana.
    TEST=VDAtest passes on Kevin with VD disabled.
    TEST=VDAtest passes on Kukui.
    TEST=crosvideo.appspot.com plays videos properly on Hana.
    TEST=crosvideo.appspot.com plays videos properly on Kevin with VD disabled.
    TEST=crosvideo.appspot.com plays videos properly on Kukui.
    TEST=Youtube Android plays properly on Hana.
    TEST=Youtube Android plays properly on Kevin with VD disabled.
    TEST=Youtube Android plays properly on Kukui.
    
    Change-Id: I88a78b786b1c90820221c9f0770a52a339913537
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982499
    Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
    Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#728450}
    9a075af9
tegra_v4l2_device.cc 9.57 KB