Skip to content

Commit 89a2b85

Browse files
iparaskevBe-ing
andauthored
Expose desktop capturer (#725)
* feat: expose DesktopCapturer Implements screen sharing by exposing libwebrtc's DesktopCapturer. A few platform specific notes: - macos: * It is using screen capture kit and the system picker by default. If the system picker is disabled then get_sources returns an empty list when trying to capture a display. The display native id needs to be acquired using different means from the client. - linux: * With pipewire the only way to select window or display is via the system picker. * use pkg-config to find Linux libraries (#2) * Support x11 dependencies * Modify example to work on x11 * Address comments * Properly guard sck options * Address review comments In particular: - Adds support for the generic capturer. - Exposes the desktop_capturer module only on macos, linux and windows. - Updates the example * Update license * Set callback on start * Make the callback FnMut * cpp formatting * Allow disabling system picker in example * Address review comments * Remove reference to temporary * Run screen-sharing example only on supported platforms * cargo fmt * Update build runner with DesktopCapturer deps on linux * Update runner * Update tests runner * fix Android build (#7) * screensharing example: remove rustls-native feature from livekit This was breaking the Android builds. * improve error handling for File::open * webrtc-sys-build: skip parsing desktop_capture.ninja on Android * webrtc-sys-build: bump prebuilt library to webrtc-0001d84-2 * Enable TLS features for the screenshare example --------- Co-authored-by: Be <be.0@gmx.com>
1 parent 4e186d3 commit 89a2b85

File tree

18 files changed

+1711
-336
lines changed

18 files changed

+1711
-336
lines changed

.github/workflows/builds.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,20 @@ jobs:
8383
run: |
8484
sudo apt update -y
8585
# libasound2-dev is needed for local_audio example
86-
sudo apt install -y libasound2-dev libssl-dev libx11-dev libgl1-mesa-dev libxext-dev
86+
# libdrm, libgbm, libxfixes, libxdamage, libxrandr, libxcomposite and libglib are needed for DesktopCapturer
87+
sudo apt install -y \
88+
libasound2-dev \
89+
libssl-dev \
90+
libx11-dev \
91+
libgl1-mesa-dev \
92+
libxext-dev \
93+
libdrm-dev \
94+
libgbm-dev \
95+
libxfixes-dev \
96+
libxdamage-dev \
97+
libxrandr-dev \
98+
libxcomposite-dev \
99+
libglib2.0-dev
87100
88101
- name: Install VA-API/NVIDIA drivers for linux x64 build
89102
if: ${{ matrix.os == 'ubuntu-latest'}}

.github/workflows/tests.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,24 @@ jobs:
8383
run: |
8484
sudo apt update -y
8585
# libasound2-dev is needed for local_audio example
86-
sudo apt install -y libasound2-dev libssl-dev libx11-dev libgl1-mesa-dev libxext-dev libva-dev libdrm-dev libnvidia-decode-570 libnvidia-compute-570 nvidia-cuda-dev
86+
# libdrm, libgbm, libxfixes, libxdamage, libxrandr, libxcomposite and libglib are needed for DesktopCapturer
87+
sudo apt install -y \
88+
libasound2-dev \
89+
libssl-dev \
90+
libx11-dev \
91+
libgl1-mesa-dev \
92+
libxext-dev \
93+
libva-dev \
94+
libdrm-dev \
95+
libnvidia-decode-570 \
96+
libnvidia-compute-570 \
97+
nvidia-cuda-dev \
98+
libgbm-dev \
99+
libxfixes-dev \
100+
libxdamage-dev \
101+
libxrandr-dev \
102+
libxcomposite-dev \
103+
libglib2.0-dev
87104
88105
- name: Install LiveKit server
89106
if: ${{ matrix.e2e-testing }}

0 commit comments

Comments
 (0)