Commit 3dd6ed31 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Mac Capture: Never request PIXEL_FORMAT_MJPEG AVCaptureVideoDataOutput

Prior to crrev.com/804584, the code to select AVCaptureVideoDataOutput's
pixel format looked like it might select PIXEL_FORMAT_MJPEG (aka dmb1
aka kCMVideoCodecType_JPEG_OpenDML), but it actually would always select
PIXEL_FORMAT_YUY2 (aka yuv2 aka kCMPixelFormat_422YpCbCr8).

And it turns out that PIXEL_FORMAT_MJPEG doesn't work. So let's make
sure we don't select it.

There remains a hunch that MJPEG will be the most efficient capture
format, and we should evaluate doing the decode and conversion
ourselves.

Bug: 1124884
Change-Id: I04473b117c05ccadbdd3226badac20656d6241a3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2399238Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: ccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805022}
parent 720108fe
...@@ -435,8 +435,11 @@ AVCaptureDeviceFormat* FindBestCaptureFormat( ...@@ -435,8 +435,11 @@ AVCaptureDeviceFormat* FindBestCaptureFormat(
} }
if (best_fourcc == kCMVideoCodecType_JPEG_OpenDML) { if (best_fourcc == kCMVideoCodecType_JPEG_OpenDML) {
[_captureSession removeOutput:_stillImageOutput]; // Capturing MJPEG directly never worked. Request a conversion to what has
_stillImageOutput.reset(); // historically been the default pixel format.
// TODO(https://crbug.com/1124884): Investigate the performance of
// performing MJPEG ourselves.
best_fourcc = kCMPixelFormat_422YpCbCr8;
} }
// The capture output has to be configured, despite Mac documentation // The capture output has to be configured, despite Mac documentation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment