[media] Fix video to canvas GPU-CPU race.
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. Bug: 819914 Change-Id: I3e6e5f83cff86beedbd76a406aa31c4eb84a0929 Reviewed-on: https://chromium-review.googlesource.com/1244835Reviewed-by:Ted Choc <tedchoc@chromium.org> Reviewed-by:
Pavel Feldman <pfeldman@chromium.org> Reviewed-by:
Sunny Sachanandani <sunnyps@chromium.org> Reviewed-by:
Antoine Labour <piman@chromium.org> Commit-Queue: Dan Sanders <sandersd@chromium.org> Cr-Commit-Position: refs/heads/master@{#594900}
Showing
Please register or sign in to comment