[macOS Capture] Fail gracefully if camera produces invalid MJPEG frame.
As detailed in https://crbug.com/1147867, after rebooting Logitech C920 produces a single invalid MJPEG sample buffer frame that we are unable to transform into I420 or NV12. Subsequent frames are valid, and this issue cannot be reproduced again until the computor is rebooted. Prior to this CL the invalid MJPEG frame causes a DCHECK crash inside SampleBufferTransformer. This CL makes it fail gracefully instead by returning null if this happens. There is no known way to cause non-MJPEG transformations to fail, so all other code paths still DCHECK. This fix is verified in both unit tests that use a clearly invalid MJPEG frame, and manually using the Logitech C920 camera. This CL unblocks making InCaptureConvertToNv12 enabled-by-default. Bug: chromium:1147867 Change-Id: Iefb6f5407918b4a8ea81f9ce41acc211ef80bdd5 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532556 Commit-Queue: Henrik Boström <hbos@chromium.org> Reviewed-by:Evan Shrubsole <eshr@google.com> Reviewed-by:
Ilya Nikolaevskiy <ilnik@chromium.org> Cr-Commit-Position: refs/heads/master@{#826728}
Showing
Please register or sign in to comment