• Dan Sanders's avatar
    [media] Reland: Fix video to canvas GPU-CPU race. · 930cc1d5
    Dan Sanders authored
    VideoFrames marked with VideoFrameMetadata::READ_LOCK_FENCES_ENABLED
    must be retained until all reads have been completed. Such frames are
    produced when software frames are uploaded to GpuMemoryBuffers. The
    VideoResourceUpdater handles this, but PaintCanvasVideoRenderer
    implemented only sync tokens.
    
    As a result, WebGL reads of software-decoded frames can tear when the
    storage is reused for later frames.
    
    This CL adds a GL_COMMANDS_COMPLETED_CHROMIUM query after each potential
    VideoFrame read in PaintCanvasVideoRenderer, and retains a reference to
    the VideoFrame until it completes. This ensures that the memory is not
    reused until after the reads complete in the GPU process.
    
    TBR=tedchoc@chromium.org,pfeldman@chromium.org
    
    Bug: 819914
    Cq-Include-Trybots: luci.chromium.try:mac_optional_gpu_tests_rel
    Change-Id: Iec05d3bca69e68ae3d3b231db84caa9bed24d777
    Reviewed-on: https://chromium-review.googlesource.com/c/1258212
    Commit-Queue: Dan Sanders <sandersd@chromium.org>
    Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#596072}
    930cc1d5
download_media_parser.cc 10.1 KB