desktop_capture: Fix SetFrameDataToBlack() to correctly support YUV/I420 black Currently, SetFrameDataToBlack() assumes the frame format is always ARGB/BGRA (4 bytes per pixel packed) and uses a flat memset to 0x00, which correctly represents transparent black for RGB. However, for YUV/I420 formats, zero-initializing the buffer results in Y=0, U=0, V=0, which maps to a distinct medium-dark green in RGB. When I420 desktop frames are cleared (e.g. inside Chromium's scaling and pillarbox/letterbox margin rendering pipeline), the margins render as bright green sidebars instead of black. This refactors SetFrameDataToBlack() to inspect the pixel_format() and correctly fill the Y plane to 0x00, and U/V planes to 0x80 (128) for standard YUV formats (FOURCC_I420, FOURCC_YV12, FOURCC_YU12, FOURCC_IYUV), yielding grayscale black. Also adds a new test to desktop_frame_unittest to verify that YUV black is set correctly. Bug: webrtc:518064225 Change-Id: Iec72c02084e60dea938b25cf8c2f8301e481526d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/476903 Reviewed-by: Alexander Cooper <alcooper@chromium.org> Commit-Queue: Jordan Bayles <jophba@google.com> Reviewed-by: Mark Foltz <mfoltz@chromium.org> Cr-Commit-Position: refs/heads/main@{#48140}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See here for instructions on how to get started developing with the native code.
Authoritative list of directories that contain the native API header files.