• mcasas's avatar
    RELAND 3: ImageCapture: Implement takePhoto() for Mac AVFoundation · 9285b167
    mcasas authored
    The original patch and the previous relands broke
    WebRtcWebcamBrowserTests/WebRtcWebcamBrowserTest.MANUAL_TestAcquiringAndReacquiringWebcam/0
    in the WebRtc Mac-tester bots, which run using a Logitech C920.
    
    The root cause was that for resolutions >= 1280x720p, the code
    configures the use of MJPEG encoding, and that seems to produce
    partially invalid JPEG markers, e.g.
    (Corrupt JPEG data: 10 extraneous bytes before marker 0xd4)
    that throw the AVCaptureStillImageOutput off.
    
    This CL disconnects |stillImageOutput_| in this case.
    
    Original description ----------------------------------------------
    ImageCapture: Implement takePhoto() for Mac AVFoundation
    
    By pulling the necessary symbols out of AVFoundation
    and using them; most notably (Cr)AVCaptureStillImageOutput.
    
    TakePhoto is already implemented for Android (both APIs).
    
    Also adding VideoCaptureDeviceTest::MAYBE_TakePhoto
    test case, enabled only for Mac.
    
    BUG=518807
    TEST=Run build with flag --enable-blink-features=ImageCapture,
    navigate to [1] and push buttons
    - Open Camera ...
    - Create ImageCapturer
    - takePhoto()  (N times!) --> profit
    
    [1] https://rawgit.com/Miguelao/demos/master/imagecapture.html
    
    TBR=rsesek@chromium.org since the change is trivial.
    
    Review-Url: https://codereview.chromium.org/2155723002
    Cr-Commit-Position: refs/heads/master@{#405889}
    9285b167
video_capture_device_mac.h 4.14 KB