Reland "[macOS Capture] Recognize NV12 and prefer it by default."
This is a reland of ca1323fe The original CL was supposed to modify FourCCToChromiumPixelFormat, but this part of the change got lost in a rebase. This reland has been rebased on top of other changes, including support for both a modern and a legacy implementation of the VideoCaptureDeviceAVFoundation. As a consequence, this CL has to have both a modern and a legacy implementation of FourCCToChromiumPixelFormat. This CL moves FourCCToChromiumPixelFormat from the utils file to the static part of the capture classes. This allows the VideoCaptureDeviceFactory to perform GetDeviceSupportedFormats() using the current implementation. Original change's description: > [macOS Capture] Recognize NV12 and prefer it by default. > > The current default is YUVY, which despite not being supported by any > cameras we've tested, is preferred[1] over the currently recognized > YUY2, which IS supported by most cameras we've tested. See [2] and > https://crbug.com/1124647. > > This CL changes the default to NV12 and makes it a recognized format. > This pixel format is more preferred (according to [1]) than both YUVY > and YUY2. An alternative would be to default to YUY2 instead, and YUVY > wouldn't be picked because it isn't in the list of supported formats, > but we have reason to believe that NV12 is a better choice for future > WebRTC patches and that this format is supported by the Chrome > rendering pipeline. > > NV12 is a planar pixel format, it has 2 planes and is contiguous in > memory. To support this, this CL adds support for planar (along with > the old nonplanar) contiguous buffers. We don't care how many planes > there are, as long as the buffer remains contiguous. > > [1] https://source.chromium.org/chromium/chromium/src/+/master:media/capture/video_capture_types.cc;l=18;drc=9e9c1706881c9a04f124ade622c10460d14fd9f5?q=media::VideoCaptureFormat::ComparePixelFormatPreference&originalUrl=https:%2F%2Fcs.chromium.org%2F > > [2] https://docs.google.com/document/d/1kcJ0Km5kAvrNFB6o7RG89bpvjOhgEo-0qorg5qm7KyA/edit?usp=sharing > > Bug: chromium:1124647 > Change-Id: I5c92e1de73922fd9ee87d8a5892438f61f2f56bd > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2391064 > Reviewed-by: Guido Urdaneta <guidou@chromium.org> > Reviewed-by: ccameron <ccameron@chromium.org> > Commit-Queue: Henrik Boström <hbos@chromium.org> > Cr-Commit-Position: refs/heads/master@{#806084} Bug: chromium:1124647 Change-Id: If7497373e7cd31966e9da4e3b1f4869d59904e1d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410380Reviewed-by:Guido Urdaneta <guidou@chromium.org> Reviewed-by:
Markus Handell <handellm@google.com> Commit-Queue: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#807429}
Showing
Please register or sign in to comment