Use libwebrtc's DesktopCapturer for screen capture #42670
+1,097
−1,839
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch builds on Linux but I have not yet tested it because I need someone to try it in a call with. 😃 I am not able to test on Windows and macOS, so I will need help testing those.
This adds support for screen sharing on Wayland (fixes #28754).
libwebrtc replaces scap, which aims to be cross platform but was only used on Windows and X11. The X11 support relied on an out-of-tree branch on which the original author closed their own pull request (CapSoftware/scap#124). This also replaces Zed's platform-specific code on macOS. Switching to a single cross platform library simplifies the code by removing the need for Zed to have its own traits for cross platform abstraction.
This uses my branch of the Livekit Rust SDK. This branch merges several pull requests I have awaiting review upstream:
Currently, the webrtc-sys crate from Livekit downloads a prebuilt static libwebrtc C++ library (which is a nonstarter for Linux distro packagers). This branch requires changes to how the C++ library is built. Because those changes in livekit/rust-sdks#725 have not yet been merged upstream, you must build libwebrtc from source to build this branch on Linux. My Livekit branch will build libwebrtc from source during the Cargo build if you set the
LK_LIBWEBRTC_SOURCEenvironment variable to the absolute path of an archive of the libwebrtc source code. In my Livekit branch, there is a script to generate this source code archive, which you can do by running:git clone https://github.com/Be-ing/rust-sdks.git -b zed cd rust-sdks/webrtc-sys/libwebrtc/ ./generate-source-archive.shThis script takes a long time to run because libwebrtc is developed as part of Chromium. Thus, it requires downloading about 9 GB of junk that isn't needed for libwebrtc. The
generate-source-archive.shscript removes a bunch of that junk to strip it down to a 125 MB .tar.xz archive, which I hope will be published upstream by Livekit when my PRs are reviewed and merged.Release Notes: