• Darin Fisher's avatar
    Allow OnCaptureResult to be called asynchronously · ad5795c8
    Darin Fisher authored
    As part of this change, DesktopCaptureDevice will explicitly stop
    capturing frames if it encounters a permanent error. This should be a
    no-op since OnError implementations are supposed to destroy the
    DesktopCapturer.
    
    A test is added to confirm that the throttling logic still works
    properly when the callbacks run asynchronously, and the Lacros
    desktop capturer is modified to run OnCaptureResult asynchronously.
    
    This CL is important because it sets the stage for further improvements
    to the Lacros capturer. It will need to use mojo's QueryVersion method
    to check for newer methods on ScreenManager that will enable more
    optimal screen capture using shared memory. QueryVersion runs
    asynchronously, which is why this CL is needed.
    
    Bug: 1133046
    Change-Id: I455294abaecdafa7e8e75d6ea660045e51c1ee4f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2440928
    Commit-Queue: Darin Fisher <darin@chromium.org>
    Reviewed-by: default avatarSergey Ulanov <sergeyu@chromium.org>
    Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#813281}
    ad5795c8
desktop_capture_device_unittest.cc 28.8 KB