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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
615d487
LiveKit Capture integrated through FFI
ladvoc b3bc926
dep on libjpeg
stephen-derosa b168aab
capture specific releases/builds and tooling. effort to reduce the sc…
stephen-derosa b9727b9
packaging tests
stephen-derosa fd9489c
build flag LIVEKIT_BUILD_CAPTURE sets LIVEKIT_CAPTURE_ENABLED macro
stephen-derosa 4682c71
Fix capture CI dependencies and Windows Cargo path lengths
stephen-derosa 8a60ba0
address cancelled async future comments
stephen-derosa b2b08eb
two step build/test: base sdk, then with capture
stephen-derosa 7b063ce
remove duplicate code
stephen-derosa db1e61a
Update CMakeLists.txt to trigger rebuild on a changed livekit-capture…
stephen-derosa 969aaf8
amalgamate
stephen-derosa 895bff2
LIVEKIT_INTERNAL_API bool dropFfiHandle
stephen-derosa 6fc3ed2
const ref
stephen-derosa 0f77a86
Fix default off for capture
alan-george-lk c3c9061
dockerfile for testing
stephen-derosa e2baaa8
clang
stephen-derosa 64a498b
rename
stephen-derosa 42be529
client-sdk-cpp base first, then install gstreamer and build capture
stephen-derosa 8ac118d
macOS x86/64 working?
stephen-derosa 51edeb8
trim docs
stephen-derosa 0c3adfc
mr comments
stephen-derosa a3753d7
Allow choosing specific backends
ladvoc 9eeb315
--capture[=list] docs update
stephen-derosa 6d09262
pipelines/testing for specific capture sources
stephen-derosa f0cf35a
livekit/capture/
stephen-derosa 8db01fe
syntax
stephen-derosa 5d4f02c
no capture on intel mac
stephen-derosa a60300a
livekit::capture
stephen-derosa 71b528b
livekit::capture fix
stephen-derosa 205a687
LiveKit capture: Additional API mods for redesign (#292)
alan-george-lk 9709913
Video source adapter
alan-george-lk ab79c0f
Conditional capture build sources
alan-george-lk 3757652
Integrate capture error type for enum
alan-george-lk a5682f0
bump rust sdk
stephen-derosa 67b3c5a
tighter guards around capture future and tests
stephen-derosa 709ac96
CaptureErrorKind when applicable, exception when not
stephen-derosa b01318f
let rust error, not the cpp sdk
stephen-derosa 4cd6c1b
update rust hash to latest release
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.
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 (all, none, or gstreamer,pattern,clock). | ||
| default: 'none' | ||
| 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 | ||
| all) args+=(--capture) ;; | ||
| 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) { | ||
| 'all' { $buildArgs += '--capture'; break } | ||
| { $_ -in @('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@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6 | ||
| 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.