• Christopher Cameron's avatar
    Add DesktopCaptureDeviceMacV2 feature · f042205d
    Christopher Cameron authored
    This adds a zero-copy desktop capture mechanism to macOS. The frames
    are captured as NV12 IOSurfaces, packaged in IOSurfaces, and passed
    directly to the consumers (e.g, compositor, encoders, etc).
    
    This implementation is a trimmed-down version of the existing system,
    which can be found in the DesktopCaptureDevice class and the WebRTC
    class ScreenCapturerMac. The CGDisplayStream code is identical to
    the WebRTC code except for the following changes:
    - It requests NV12 as the capture format
    - It specifies the requested capture resolution (rather than capturing
      at retina resolution and downsampling in software)
    - It specifies kCGDisplayStreamMinimumFrameTime and
      kCGDisplayStreamColorSpace.
    Otherwise, all calls are identical.
    
    Bug: 1164736
    Change-Id: I962911aa9b1863d730c333866f5644bbbd2b7164
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2616802
    Commit-Queue: ccameron <ccameron@chromium.org>
    Reviewed-by: default avatarMarkus Handell <handellm@google.com>
    Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
    Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
    Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#843989}
    f042205d
BUILD.gn 121 KB