Skip to content

Commit e1e6a80

Browse files
capture specific releases/builds and tooling. effort to reduce the scope of the public API WRT capture.
1 parent ac5df3c commit e1e6a80

27 files changed

Lines changed: 755 additions & 838 deletions

‎.build-info.json.in‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
"cpp_git_commit": "@GIT_COMMIT@",
55
"rust_submodule_commit": "@RUST_GIT_COMMIT@",
66
"livekit_ffi_version": "@LIVEKIT_FFI_VERSION@",
7+
"capture_enabled": @LIVEKIT_CAPTURE_ENABLED@,
8+
"cargo_features": "@LIVEKIT_CARGO_FEATURES@",
79
"build_date": "@BUILD_DATE@"
810
}

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
data/welcome.wav filter=lfs diff=lfs merge=lfs -text
22
build.cmd whitespace=cr-at-eol
3+
CMakePresets.json whitespace=cr-at-eol
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Set up capture dependencies
2+
description: Install GStreamer development files and runtime plugins for capture bundles.
3+
runs:
4+
using: composite
5+
steps:
6+
- name: Install GStreamer (Linux)
7+
if: runner.os == 'Linux'
8+
shell: bash
9+
run: |
10+
sudo apt-get update
11+
sudo apt-get install -y libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
12+
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
13+
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
14+
- name: Install GStreamer (macOS)
15+
if: runner.os == 'macOS'
16+
shell: bash
17+
run: brew install gstreamer
18+
- name: Install GStreamer (Windows)
19+
if: runner.os == 'Windows'
20+
env:
21+
GSTREAMER_WINDOWS_VERSION: "1.28.5"
22+
GSTREAMER_WINDOWS_SHA256: "51ee5eaec33008e8409d8cf6f6884457f22aa3bd515f8856f993a3eaab903530"
23+
shell: pwsh
24+
run: |
25+
$installer = Join-Path $env:RUNNER_TEMP "gstreamer-installer.exe"
26+
$installDir = Join-Path $env:RUNNER_TEMP "gstreamer"
27+
$uri = "https://gstreamer.freedesktop.org/data/pkg/windows/$env:GSTREAMER_WINDOWS_VERSION/msvc/gstreamer-1.0-msvc-x86_64-$env:GSTREAMER_WINDOWS_VERSION.exe"
28+
29+
Invoke-WebRequest -Uri $uri -OutFile $installer
30+
$actualHash = (Get-FileHash -Algorithm SHA256 $installer).Hash.ToLowerInvariant()
31+
if ($actualHash -ne $env:GSTREAMER_WINDOWS_SHA256) {
32+
throw "GStreamer installer SHA-256 mismatch: expected $env:GSTREAMER_WINDOWS_SHA256, got $actualHash"
33+
}
34+
35+
$process = Start-Process -FilePath $installer -ArgumentList @(
36+
"/TYPE=devel",
37+
"/DIR=$installDir",
38+
"/CURRENTUSER",
39+
"/VERYSILENT",
40+
"/NORESTART"
41+
) -Wait -PassThru
42+
if ($process.ExitCode -ne 0) {
43+
throw "GStreamer installer failed with exit code $($process.ExitCode)"
44+
}
45+
46+
"$installDir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
47+
"PKG_CONFIG_PATH=$installDir\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append

‎.github/scripts/check_no_private_symbols.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
"google::protobuf",
5858
"absl::",
5959
"nlohmann::",
60+
# Capture pipelines are private Rust/GStreamer implementation details.
61+
"gstreamer::",
62+
"gst_",
6063
# Generated UniFFI C++ binding API and runtime implementation.
6164
"livekit_ffi::",
6265
"uniffi::",

‎.github/workflows/builds.yml‎

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,43 @@ jobs:
6262
build_cmd: .\build.cmd release-examples --bundle --prefix sdk-out\livekit-sdk-windows-x64
6363
build_dir: build-release
6464

65+
- os: ubuntu-22.04
66+
name: ubuntu-22.04-x64-capture
67+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-x64-capture
68+
build_dir: build-release
69+
capture: true
70+
- os: ubuntu-22.04-arm
71+
name: ubuntu-22.04-arm64-capture
72+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-22.04-arm64-capture
73+
build_dir: build-release
74+
capture: true
75+
- os: ubuntu-24.04
76+
name: ubuntu-24.04-x64-capture
77+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-x64-capture
78+
build_dir: build-release
79+
capture: true
80+
- os: ubuntu-24.04-arm
81+
name: ubuntu-24.04-arm64-capture
82+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-ubuntu-24.04-arm64-capture
83+
build_dir: build-release
84+
capture: true
85+
- os: macos-26-xlarge
86+
name: macos-arm64-capture
87+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-arm64-capture
88+
build_dir: build-release
89+
capture: true
90+
- os: macos-26-large
91+
name: macos-x64-capture
92+
build_cmd: ./build.sh release-examples --capture --bundle --prefix sdk-out/livekit-sdk-macos-x64-capture --macos-arch x86_64
93+
build_dir: build-release
94+
# Pinned to Windows 2022 for current VS 17 implementation
95+
capture: true
96+
- os: windows-2022
97+
name: windows-x64-capture
98+
build_cmd: .\build.cmd release-examples --capture --bundle --prefix sdk-out\livekit-sdk-windows-x64-capture
99+
build_dir: build-release
100+
capture: true
101+
65102
name: Build (${{ matrix.name }})
66103
runs-on: ${{ matrix.os }}
67104

@@ -140,14 +177,18 @@ jobs:
140177
brew update
141178
brew install cmake ninja protobuf abseil
142179
180+
- name: Set up capture dependencies
181+
if: matrix.capture == true
182+
uses: ./.github/actions/setup-capture
183+
143184
# ---------- Rust toolchain ----------
144185
- name: Install Rust (stable)
145186
uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
146187
with:
147188
toolchain: stable
148189

149190
- name: Install Rust cross-compilation target
150-
if: matrix.name == 'macos-x64'
191+
if: startsWith(matrix.name, 'macos-x64')
151192
run: rustup target add x86_64-apple-darwin
152193

153194
# ---------- Cache Cargo ----------
@@ -345,6 +386,31 @@ jobs:
345386
test -f "${bundle}/lib/cmake/LiveKit/LiveKitConfigVersion.cmake"
346387
test -f "${bundle}/lib/cmake/LiveKit/LiveKitTargets.cmake"
347388
389+
- name: Smoke-test installed capture SDK (Unix)
390+
if: matrix.capture == true && runner.os != 'Windows'
391+
shell: bash
392+
run: |
393+
bundle="$GITHUB_WORKSPACE/sdk-out/livekit-sdk-${{ matrix.name }}"
394+
arch_args=()
395+
if [[ "${{ matrix.name }}" == macos-x64* ]]; then arch_args+=(-DCMAKE_OSX_ARCHITECTURES=x86_64); fi
396+
cmake -S scripts/capture-bundle-smoke -B capture-smoke -G Ninja \
397+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$bundle" "${arch_args[@]}"
398+
cmake --build capture-smoke
399+
./capture-smoke/capture_bundle_smoke
400+
401+
- name: Smoke-test installed capture SDK (Windows)
402+
if: matrix.capture == true && runner.os == 'Windows'
403+
shell: pwsh
404+
run: |
405+
$bundle = Join-Path $env:GITHUB_WORKSPACE "sdk-out/livekit-sdk-${{ matrix.name }}"
406+
cmake -S scripts/capture-bundle-smoke -B capture-smoke -DCMAKE_PREFIX_PATH="$bundle"
407+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
408+
cmake --build capture-smoke --config Release
409+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
410+
$env:PATH = "$bundle\bin;$env:PATH"
411+
& .\capture-smoke\Release\capture_bundle_smoke.exe
412+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
413+
348414
# ---------- Upload artifacts ----------
349415
- name: Upload SDK bundle
350416
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ jobs:
4949
- vcpkg.json
5050
- .github/workflows/ci.yml
5151
- .github/workflows/builds.yml
52+
- .github/workflows/make-release.yml
53+
- .github/actions/setup-capture/**
54+
- .github/scripts/check_no_private_symbols.py
55+
- scripts/capture-bundle-smoke/**
5256
tests:
5357
- src/**
5458
- include/**

‎.github/workflows/make-release.yml‎

Lines changed: 82 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
required: true
1212
type: string
1313

14+
permissions:
15+
contents: read
16+
1417
env:
1518
CARGO_TERM_COLOR: always
1619
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
@@ -47,6 +50,36 @@ jobs:
4750
name: windows-x64
4851
generator: "Visual Studio 17 2022"
4952

53+
- os: ubuntu-22.04
54+
name: ubuntu-22.04-x64-capture
55+
generator: Ninja
56+
capture: true
57+
- os: ubuntu-22.04-arm
58+
name: ubuntu-22.04-arm64-capture
59+
generator: Ninja
60+
capture: true
61+
- os: ubuntu-24.04
62+
name: ubuntu-24.04-x64-capture
63+
generator: Ninja
64+
capture: true
65+
- os: ubuntu-24.04-arm
66+
name: ubuntu-24.04-arm64-capture
67+
generator: Ninja
68+
capture: true
69+
- os: macos-26-xlarge
70+
name: macos-arm64-capture
71+
generator: Ninja
72+
capture: true
73+
- os: macos-26-large
74+
name: macos-x64-capture
75+
generator: Ninja
76+
# Pinned to Windows 2022 for current VS 17 implementation
77+
capture: true
78+
- os: windows-2022
79+
name: windows-x64-capture
80+
generator: "Visual Studio 17 2022"
81+
capture: true
82+
5083
name: Build (${{ matrix.name }})
5184
runs-on: ${{ matrix.os }}
5285

@@ -140,14 +173,18 @@ jobs:
140173
brew update
141174
brew install cmake ninja protobuf abseil
142175
176+
- name: Set up capture dependencies
177+
if: matrix.capture == true
178+
uses: ./.github/actions/setup-capture
179+
143180
# ---------- Rust toolchain ----------
144181
- name: Install Rust (stable)
145182
uses: dtolnay/rust-toolchain@7e38f4b43b4db5c8dd498af069a4f6196df1d067
146183
with:
147184
toolchain: stable
148185

149186
- name: Install Rust cross-compilation target
150-
if: matrix.name == 'macos-x64'
187+
if: startsWith(matrix.name, 'macos-x64')
151188
run: rustup target add x86_64-apple-darwin
152189

153190
# ---------- Cache Cargo ----------
@@ -217,10 +254,12 @@ jobs:
217254
exit 1
218255
fi
219256
220-
if [[ "${{ matrix.name }}" == "macos-x64" ]]; then
221-
./build.sh release-examples --version "$version" --bundle --prefix "$bundleDir" --macos-arch x86_64
257+
capture_args=()
258+
if [[ "${{ matrix.capture }}" == "true" ]]; then capture_args+=(--capture); fi
259+
if [[ "${{ matrix.name }}" == macos-x64* ]]; then
260+
./build.sh release-examples "${capture_args[@]}" --version "$version" --bundle --prefix "$bundleDir" --macos-arch x86_64
222261
else
223-
./build.sh release-examples --version "$version" --bundle --prefix "$bundleDir"
262+
./build.sh release-examples "${capture_args[@]}" --version "$version" --bundle --prefix "$bundleDir"
224263
fi
225264
226265
# List bundle contents
@@ -257,7 +296,10 @@ jobs:
257296
$bundleDir = "sdk-out/livekit-sdk-${{ matrix.name }}-$version"
258297
259298
if ([string]::IsNullOrWhiteSpace($version)) { throw "version is empty" }
260-
.\build.cmd release-examples --version "$version" --bundle --prefix "$bundleDir"
299+
$captureArgs = @()
300+
if ("${{ matrix.capture }}" -eq "true") { $captureArgs += "--capture" }
301+
.\build.cmd release-examples @captureArgs --version "$version" --bundle --prefix "$bundleDir"
302+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
261303
262304
Write-Host "Bundle contents:"
263305
Get-ChildItem -Recurse -File $bundleDir | Select-Object -First 200 | ForEach-Object { $_.FullName }
@@ -338,6 +380,31 @@ jobs:
338380
throw "Build info is missing livekit-ffi version"
339381
}
340382
383+
- name: Smoke-test installed capture SDK (Unix)
384+
if: matrix.capture == true && runner.os != 'Windows'
385+
shell: bash
386+
run: |
387+
bundle="$GITHUB_WORKSPACE/sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }}"
388+
arch_args=()
389+
if [[ "${{ matrix.name }}" == macos-x64* ]]; then arch_args+=(-DCMAKE_OSX_ARCHITECTURES=x86_64); fi
390+
cmake -S scripts/capture-bundle-smoke -B capture-smoke -G Ninja \
391+
-DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$bundle" "${arch_args[@]}"
392+
cmake --build capture-smoke
393+
./capture-smoke/capture_bundle_smoke
394+
395+
- name: Smoke-test installed capture SDK (Windows)
396+
if: matrix.capture == true && runner.os == 'Windows'
397+
shell: pwsh
398+
run: |
399+
$bundle = Join-Path $env:GITHUB_WORKSPACE "sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }}"
400+
cmake -S scripts/capture-bundle-smoke -B capture-smoke -DCMAKE_PREFIX_PATH="$bundle"
401+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
402+
cmake --build capture-smoke --config Release
403+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
404+
$env:PATH = "$bundle\bin;$env:PATH"
405+
& .\capture-smoke\Release\capture_bundle_smoke.exe
406+
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
407+
341408
# ---------- Upload artifact (raw directory, no pre-compression) ----------
342409
- name: Upload build artifact
343410
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
@@ -412,14 +479,14 @@ jobs:
412479
echo "Artifacts downloaded:"
413480
ls -la
414481
415-
# Create tar.gz for Ubuntu and macOS
482+
# Standard and capture-enabled Ubuntu and macOS bundles.
416483
for platform in ubuntu-22.04-x64 ubuntu-22.04-arm64 ubuntu-24.04-x64 ubuntu-24.04-arm64 macos-arm64 macos-x64; do
417-
dirName="livekit-sdk-${platform}-${VERSION}"
418-
if [[ -d "${dirName}" ]]; then
419-
echo "Creating archive for ${platform}..."
484+
for suffix in "" "-capture"; do
485+
dirName="livekit-sdk-${platform}${suffix}-${VERSION}"
486+
test -d "${dirName}"
420487
tar -czf "${{ github.workspace }}/release-assets/${dirName}.tar.gz" "${dirName}"
421488
echo "Created: ${dirName}.tar.gz"
422-
fi
489+
done
423490
done
424491
425492
# Deprecated compatibility aliases for existing Linux release consumers.
@@ -437,13 +504,12 @@ jobs:
437504
fi
438505
done
439506
440-
# Create zip for Windows
441-
dirName="livekit-sdk-windows-x64-${VERSION}"
442-
if [[ -d "${dirName}" ]]; then
443-
echo "Creating archive for windows-x64..."
507+
# Standard and capture-enabled Windows bundles.
508+
for suffix in "" "-capture"; do
509+
dirName="livekit-sdk-windows-x64${suffix}-${VERSION}"
510+
test -d "${dirName}"
444511
zip -r "${{ github.workspace }}/release-assets/${dirName}.zip" "${dirName}"
445-
echo "Created: ${dirName}.zip"
446-
fi
512+
done
447513
448514
- name: List release assets
449515
run: ls -la ${{ github.workspace }}/release-assets/

‎AGENTS.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ Be sure to update the directory layout in this file if the directory layout chan
9494
| `scripts/` | Local helper scripts for SDK-specific development tasks |
9595
| `docs/` | Documentation root. `docs/` holds hand-written long-form Markdown intended to also read well on GitHub. |
9696
| `docs/doxygen/` | Doxygen tool config, theme assets, and Doxygen-only content (`Doxyfile`, `index.md` mainpage, `customization/*.css`, `customization/header.html`, `customization/favicon.ico`). Files here use Doxygen-only syntax (`@ref`, `@brief`, …) and are not intended for human reading on their own. |
97+
| `scripts/capture-bundle-smoke/` | Standalone downstream CMake consumer that validates capture-enabled SDK bundles |
98+
| `.github/actions/setup-capture/` | Shared CI setup for capture runtime and development dependencies |
9799
| `.github/workflows/` | GitHub Actions CI workflows |
98100

99101
### Key Types
@@ -126,6 +128,18 @@ To create an installable SDK bundle, use the same build command with
126128
`./build.sh release --bundle --prefix sdk-out/livekit-sdk`). On Windows, use
127129
`build.cmd release --bundle --prefix C:\path\to\livekit-sdk`.
128130

131+
Both build scripts accept `--capture` to enable GStreamer, pattern, and clock
132+
sources, and `--no-capture` to disable them. Test/all presets enable capture by
133+
default; normal and example presets disable it. Capture-enabled builds need
134+
GStreamer development and runtime libraries. Release workflows publish separate
135+
`-capture` bundles and validate creation through the installed SDK using
136+
`scripts/capture-bundle-smoke/`.
137+
138+
Rust FFI outputs live under `client-sdk-rust/target/cpp-<feature-hash>/` to isolate
139+
Cargo feature configurations. Generated public build metadata lives under each
140+
build directory's `generated/include/livekit/build.h`; do not generate it into
141+
the source tree. Track capture Rust sources and shaders in build dependencies.
142+
129143
The build scripts pass an explicit job count to `cmake --build --parallel`. Set
130144
`CMAKE_BUILD_PARALLEL_LEVEL` to override the default detected logical CPU count.
131145

@@ -338,6 +352,7 @@ malformed table, missing `@param` on a documented function, …) fails the build
338352
| nlohmann/json | **Private** | Header-only; vendored via FetchContent (Unix) or vcpkg (Windows); must NOT leak into public API |
339353
| client-sdk-rust | Build-time | Git submodule, built via cargo during CMake build |
340354
| cpp-tools | Developer / CI | Git submodule containing shared LiveKit C++ formatting and static-analysis tooling |
355+
| GStreamer | Capture builds / runtime | System libraries and plugins; accessed through Rust; not redistributed in SDK bundles |
341356
| Google Test | Test only | FetchContent in `src/tests/CMakeLists.txt` |
342357

343358
When adding a new private/vendored dependency to this table, also add a

0 commit comments

Comments
 (0)