Repository navigation
LK Capture integration #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stephen-derosa
wants to merge
27
commits into
main
Choose a base branch
from
sderosa/capture-no-device-source
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
a7207c5
LiveKit Capture integrated through FFI
ladvoc 9be6f0a
dep on libjpeg
stephen-derosa 4f168ff
capture specific releases/builds and tooling. effort to reduce the sc…
stephen-derosa e861576
packaging tests
stephen-derosa 885e5b0
build flag LIVEKIT_BUILD_CAPTURE sets LIVEKIT_CAPTURE_ENABLED macro
stephen-derosa 3f9e399
Fix capture CI dependencies and Windows Cargo path lengths
stephen-derosa 3d619c6
address cancelled async future comments
stephen-derosa 771299e
two step build/test: base sdk, then with capture
stephen-derosa 8028ce7
remove duplicate code
stephen-derosa 7f6ddca
Update CMakeLists.txt to trigger rebuild on a changed livekit-capture…
stephen-derosa bef62f0
amalgamate
stephen-derosa 68c5983
LIVEKIT_INTERNAL_API bool dropFfiHandle
stephen-derosa 517c75e
const ref
stephen-derosa cb20ce5
Fix default off for capture
alan-george-lk b4e67d9
dockerfile for testing
stephen-derosa 3c0a66d
clang
stephen-derosa 0663d22
rename
stephen-derosa 5b24529
rust hash points to release
stephen-derosa 69e334d
client-sdk-cpp base first, then install gstreamer and build capture
stephen-derosa a990fad
macOS x86/64 working?
stephen-derosa 7f53a2f
trim docs
stephen-derosa f01b51e
mr comments
stephen-derosa f5ec27a
Allow choosing specific backends
ladvoc fd8942d
--capture[=list] docs update
stephen-derosa 9d6b121
pipelines/testing for specific capture sources
stephen-derosa bff2394
livekit/capture/
stephen-derosa 34a525d
syntax
stephen-derosa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| data/welcome.wav filter=lfs diff=lfs merge=lfs -text | ||
| build.cmd whitespace=cr-at-eol | ||
| CMakePresets.json whitespace=cr-at-eol |
|
stephen-derosa marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Build SDK | ||
| description: Configure and build an SDK variant with the repository build scripts. | ||
| inputs: | ||
| preset: | ||
| description: Build script command, such as release-examples or debug-tests. | ||
| required: true | ||
| capture: | ||
| description: Capture sources (ON/all, OFF/none, or gstreamer,pattern,clock). | ||
| default: 'OFF' | ||
| bundle-dir: | ||
| description: Optional installation directory for an SDK bundle. | ||
| default: '' | ||
| version: | ||
| description: Optional SDK version to inject. | ||
| default: '' | ||
| macos-arch: | ||
| description: Optional macOS architecture override. | ||
| default: '' | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Build (Unix) | ||
| if: runner.os != 'Windows' | ||
| shell: bash | ||
| env: | ||
| SDK_PRESET: ${{ inputs.preset }} | ||
| SDK_CAPTURE: ${{ inputs.capture }} | ||
| SDK_BUNDLE_DIR: ${{ inputs.bundle-dir }} | ||
| SDK_VERSION: ${{ inputs.version }} | ||
| SDK_MACOS_ARCH: ${{ inputs.macos-arch }} | ||
| run: | | ||
| args=(./build.sh "$SDK_PRESET") | ||
| case "$SDK_CAPTURE" in | ||
| ON|all) args+=(--capture) ;; | ||
| OFF|none|"") args+=(--no-capture) ;; | ||
| *) args+=(--capture="$SDK_CAPTURE") ;; | ||
| esac | ||
| if [[ -n "$SDK_BUNDLE_DIR" ]]; then args+=(--bundle --prefix "$SDK_BUNDLE_DIR"); fi | ||
| if [[ -n "$SDK_VERSION" ]]; then args+=(--version "$SDK_VERSION"); fi | ||
| if [[ -n "$SDK_MACOS_ARCH" ]]; then args+=(--macos-arch "$SDK_MACOS_ARCH"); fi | ||
| "${args[@]}" | ||
| - name: Build (Windows) | ||
| if: runner.os == 'Windows' | ||
| shell: pwsh | ||
| env: | ||
| SDK_PRESET: ${{ inputs.preset }} | ||
| SDK_CAPTURE: ${{ inputs.capture }} | ||
| SDK_BUNDLE_DIR: ${{ inputs.bundle-dir }} | ||
| SDK_VERSION: ${{ inputs.version }} | ||
| run: | | ||
| $buildArgs = @($env:SDK_PRESET) | ||
| switch ([string]$env:SDK_CAPTURE) { | ||
| { $_ -in @('ON', 'all') } { $buildArgs += '--capture'; break } | ||
| { $_ -in @('OFF', 'none', '') } { $buildArgs += '--no-capture'; break } | ||
| default { $buildArgs += "--capture=$($env:SDK_CAPTURE)" } | ||
| } | ||
| if ($env:SDK_BUNDLE_DIR) { $buildArgs += @('--bundle', '--prefix', $env:SDK_BUNDLE_DIR) } | ||
| if ($env:SDK_VERSION) { $buildArgs += @('--version', $env:SDK_VERSION) } | ||
| & .\build.cmd @buildArgs | ||
| if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Set Cargo output root | ||
| description: Use a short Cargo root on Windows and the submodule target directory elsewhere. | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - shell: bash | ||
| run: | | ||
| if [[ "$RUNNER_OS" == "Windows" ]]; then | ||
| echo "CARGO_TARGET_DIR=$(cygpath -m "$RUNNER_TEMP")/lk-rust" >> "$GITHUB_ENV" | ||
| else | ||
| echo "CARGO_TARGET_DIR=$GITHUB_WORKSPACE/client-sdk-rust/target" >> "$GITHUB_ENV" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Check SDK exported symbols | ||
| description: Reject private dependency symbols exported by an installed SDK. | ||
| inputs: | ||
| bundle-dir: | ||
| description: SDK installation directory relative to the workspace. | ||
| required: true | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - shell: bash | ||
| env: | ||
| SDK_BUNDLE_DIR: ${{ inputs.bundle-dir }} | ||
| run: | | ||
| case "$RUNNER_OS" in | ||
| Windows) lib="$SDK_BUNDLE_DIR/bin/livekit.dll" ;; | ||
| macOS) lib="$SDK_BUNDLE_DIR/lib/liblivekit.dylib" ;; | ||
| Linux) lib="$SDK_BUNDLE_DIR/lib/liblivekit.so" ;; | ||
| *) echo "Unsupported runner OS: $RUNNER_OS" >&2; exit 1 ;; | ||
| esac | ||
| python .github/scripts/check_no_private_symbols.py "$lib" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| name: Set up capture dependencies | ||
| description: Install additional build and runtime dependencies for capture-enabled SDK builds. | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Install GStreamer (Linux) | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| run: | | ||
| sudo apt-get update | ||
| # Request the distro unwinder explicitly so apt can replace conflicting | ||
| # LLVM unwinder development packages on Ubuntu 22.04 runners. | ||
| sudo apt-get install -y libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ | ||
| gstreamer1.0-plugins-base gstreamer1.0-plugins-good \ | ||
| gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav | ||
| - name: Install GStreamer (macOS) | ||
| if: runner.os == 'macOS' | ||
| env: | ||
| GSTREAMER_MACOS_VERSION: "1.28.5" | ||
| GSTREAMER_MACOS_RUNTIME_SHA256: "0a8fc7a1cf8d7bac833ca0ebe2fd196a199c2465e810cd5b1e4b4f720c258f43" | ||
| GSTREAMER_MACOS_DEVEL_SHA256: "6f7b55e8fb86dcc615c9cae46b79b7785851e5c77f79a938648a81dfa2603729" | ||
| shell: bash | ||
| run: | | ||
| set -euo pipefail | ||
| # Official universal packages cover both x86_64 and arm64. Homebrew | ||
| # no longer produces Intel bottles and may compile its dependency tree. | ||
| base_url="https://gstreamer.freedesktop.org/data/pkg/osx/$GSTREAMER_MACOS_VERSION" | ||
| installer_dir="$RUNNER_TEMP/gstreamer-installers" | ||
| runtime_pkg="gstreamer-1.0-$GSTREAMER_MACOS_VERSION-universal.pkg" | ||
| devel_pkg="gstreamer-1.0-devel-$GSTREAMER_MACOS_VERSION-universal.pkg" | ||
| mkdir -p "$installer_dir" | ||
|
|
||
| for package in "$runtime_pkg" "$devel_pkg"; do | ||
| expected_hash="$GSTREAMER_MACOS_RUNTIME_SHA256" | ||
| if [[ "$package" == "$devel_pkg" ]]; then | ||
| expected_hash="$GSTREAMER_MACOS_DEVEL_SHA256" | ||
| fi | ||
| curl --fail --location --retry 3 --connect-timeout 30 --max-time 600 \ | ||
| "$base_url/$package" --output "$installer_dir/$package" | ||
| printf '%s %s\n' "$expected_hash" "$installer_dir/$package" | shasum -a 256 -c - | ||
| done | ||
|
|
||
| # Verify both downloads before installing either package. | ||
| sudo installer -pkg "$installer_dir/$runtime_pkg" -target / | ||
| sudo installer -pkg "$installer_dir/$devel_pkg" -target / | ||
|
|
||
| framework="/Library/Frameworks/GStreamer.framework/Versions/1.0" | ||
| echo "$framework/bin" >> "$GITHUB_PATH" | ||
| export PATH="$framework/bin:$PATH" | ||
| export PKG_CONFIG_PATH="$framework/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" | ||
| echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> "$GITHUB_ENV" | ||
| # The framework dylibs use @rpath. Rust sys-crate linker arguments do | ||
| # not propagate to the final FFI dylib, so set its runtime search path. | ||
| echo "RUSTFLAGS=${RUSTFLAGS:+$RUSTFLAGS }-C link-arg=-Wl,-rpath,$framework/lib" >> "$GITHUB_ENV" | ||
| pkg-config --modversion gstreamer-1.0 gstreamer-app-1.0 | ||
| gst-inspect-1.0 --version | ||
| - name: Install GStreamer (Windows) | ||
| if: runner.os == 'Windows' | ||
| env: | ||
| GSTREAMER_WINDOWS_VERSION: "1.28.5" | ||
| GSTREAMER_WINDOWS_SHA256: "51ee5eaec33008e8409d8cf6f6884457f22aa3bd515f8856f993a3eaab903530" | ||
| shell: pwsh | ||
| run: | | ||
| $installer = Join-Path $env:RUNNER_TEMP "gstreamer-installer.exe" | ||
| $installDir = Join-Path $env:RUNNER_TEMP "gstreamer" | ||
| $uri = "https://gstreamer.freedesktop.org/data/pkg/windows/$env:GSTREAMER_WINDOWS_VERSION/msvc/gstreamer-1.0-msvc-x86_64-$env:GSTREAMER_WINDOWS_VERSION.exe" | ||
|
|
||
| Invoke-WebRequest -Uri $uri -OutFile $installer | ||
| $actualHash = (Get-FileHash -Algorithm SHA256 $installer).Hash.ToLowerInvariant() | ||
| if ($actualHash -ne $env:GSTREAMER_WINDOWS_SHA256) { | ||
| throw "GStreamer installer SHA-256 mismatch: expected $env:GSTREAMER_WINDOWS_SHA256, got $actualHash" | ||
| } | ||
|
|
||
| $process = Start-Process -FilePath $installer -ArgumentList @( | ||
| "/TYPE=devel", | ||
| "/DIR=$installDir", | ||
| "/CURRENTUSER", | ||
| "/VERYSILENT", | ||
| "/NORESTART" | ||
| ) -Wait -PassThru | ||
| if ($process.ExitCode -ne 0) { | ||
| throw "GStreamer installer failed with exit code $($process.ExitCode)" | ||
| } | ||
|
|
||
| "$installDir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
| "PKG_CONFIG_PATH=$installDir\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Copyright 2026 LiveKit, Inc. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: Set up base SDK dependencies | ||
| description: Install base SDK packages and the build compiler, without capture dependencies. | ||
| inputs: | ||
| vcpkg-commit: | ||
| description: Pinned vcpkg revision for Windows builds. | ||
| default: fb87e2bb3fe69e16c224989acb5a61349166c782 | ||
| linux-extra-packages: | ||
| description: Optional space-separated Linux packages to install with the base dependencies. | ||
| default: '' | ||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Setup vcpkg (Windows only) | ||
| if: runner.os == 'Windows' | ||
| uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5 | ||
| with: | ||
| vcpkgGitCommitId: ${{ inputs.vcpkg-commit }} | ||
|
|
||
| - name: Install base deps (Ubuntu) | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| env: | ||
| SDK_EXTRA_PACKAGES: ${{ inputs.linux-extra-packages }} | ||
| run: | | ||
| set -eux | ||
| extra_packages=() | ||
| if [[ -n "$SDK_EXTRA_PACKAGES" ]]; then | ||
| read -r -a extra_packages <<< "$SDK_EXTRA_PACKAGES" | ||
| fi | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| build-essential cmake ninja-build pkg-config \ | ||
| llvm-dev libclang-dev clang \ | ||
| libva-dev libdrm-dev libgbm-dev libx11-dev libgl1-mesa-dev \ | ||
| libxext-dev libxcomposite-dev libxdamage-dev libxfixes-dev \ | ||
| libxrandr-dev libxi-dev libxkbcommon-dev \ | ||
| libasound2-dev libpulse-dev \ | ||
| libssl-dev \ | ||
| libprotobuf-dev protobuf-compiler \ | ||
| libabsl-dev \ | ||
| libcurl4-openssl-dev \ | ||
| libwayland-dev libdecor-0-dev \ | ||
| "${extra_packages[@]}" | ||
|
|
||
| # libwebrtc ships hermetic libc++ headers that require a newer clang than | ||
| # Ubuntu provides. The submodule script exports CC/CXX for later steps. | ||
| - name: Install clang for libwebrtc | ||
| if: runner.os == 'Linux' | ||
| shell: bash | ||
| run: client-sdk-rust/.github/scripts/install-clang.sh | ||
|
|
||
| - name: Install base deps (macOS) | ||
| if: runner.os == 'macOS' | ||
| shell: bash | ||
| run: | | ||
| set -eux | ||
| brew update | ||
| brew install cmake ninja protobuf abseil |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.