Skip to content

Commit f01b51e

Browse files
mr comments
1 parent 7f53a2f commit f01b51e

13 files changed

Lines changed: 101 additions & 159 deletions

File tree

.github/actions/check-sdk-abi/action.yml renamed to .github/actions/check-sdk-symbols/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: Check SDK exported ABI
15+
name: Check SDK exported symbols
1616
description: Reject private dependency symbols exported by an installed SDK.
1717
inputs:
1818
bundle-dir:

‎.github/actions/setup-capture/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Set up capture dependencies
2-
description: Install GStreamer development files and runtime plugins for capture bundles.
2+
description: Install additional build and runtime dependencies for capture-enabled SDK builds.
33
runs:
44
using: composite
55
steps:

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- .github/actions/cargo-target-root/**
5757
- .github/actions/smoke-examples/**
5858
- .github/actions/test-sdk-bundle/**
59-
- .github/actions/check-sdk-abi/**
59+
- .github/actions/check-sdk-symbols/**
6060
- .github/scripts/check_no_private_symbols.py
6161
tests:
6262
- src/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ jobs:
187187
python-version: '3.x'
188188

189189
- name: Symbol leak check (standard SDK)
190-
uses: ./.github/actions/check-sdk-abi
190+
uses: ./.github/actions/check-sdk-symbols
191191
with:
192192
bundle-dir: sdk-out/livekit-sdk-${{ matrix.name }}-${{ steps.version.outputs.version }}
193193

@@ -212,7 +212,7 @@ jobs:
212212
macos-arch: ${{ matrix.macos_arch || '' }}
213213

214214
- name: Symbol leak check (capture SDK)
215-
uses: ./.github/actions/check-sdk-abi
215+
uses: ./.github/actions/check-sdk-symbols
216216
with:
217217
bundle-dir: sdk-out/livekit-sdk-${{ matrix.name }}-capture-${{ steps.version.outputs.version }}
218218

‎docker/linux-build.Dockerfile‎

Lines changed: 0 additions & 66 deletions
This file was deleted.

‎docker/linux-build.Dockerfile.dockerignore‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎docs/building.md‎

Lines changed: 47 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,49 @@ CMake/vcpkg flows.
2323
| Linux | GCC 9+ or Clang 10+ | `apt` / `dnf` (or vcpkg) |
2424
| macOS | Xcode 12+ (macOS 12.3+ for ScreenCaptureKit) | Homebrew (or vcpkg) |
2525

26+
<a id="additional-capture-dependencies"></a>
27+
28+
### Additional capture dependencies
29+
30+
Standard SDK builds do not require GStreamer. Capture-enabled builds
31+
(`--capture`) require GStreamer development libraries at build time and
32+
GStreamer libraries at runtime, including when using pattern or clock sources.
33+
The SDK does not redistribute these libraries or plugins. Install the runtime
34+
plugins required by your GStreamer pipeline too.
35+
36+
**macOS:** Install both the official universal runtime and development packages
37+
from the [GStreamer downloads page](https://gstreamer.freedesktop.org/download/#macos).
38+
These packages support both x86_64 and arm64. Configure the framework paths:
39+
40+
```bash
41+
export PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/bin:$PATH"
42+
export PKG_CONFIG_PATH="/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}"
43+
```
44+
45+
Use one GStreamer installation method per machine to keep libraries and plugins
46+
consistent.
47+
48+
**Ubuntu / Debian:** Install the development packages and runtime plugins:
49+
50+
```bash
51+
sudo apt install -y pkg-config libunwind-dev \
52+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
53+
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
54+
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav
55+
```
56+
57+
**Windows:** Install the MSVC x86_64 runtime and development components from the
58+
[GStreamer downloads page](https://gstreamer.freedesktop.org/download/#windows).
59+
Add the installation's `bin` directory to `PATH` and its `lib/pkgconfig`
60+
directory to `PKG_CONFIG_PATH`.
61+
62+
Development files must be discoverable through `pkg-config`. You can verify
63+
that they are available with:
64+
65+
```bash
66+
pkg-config --modversion gstreamer-1.0 gstreamer-app-1.0
67+
```
68+
2669
## Clone the repository
2770

2871
The SDK depends on the [`client-sdk-rust`](https://github.com/livekit/rust-sdks)
@@ -378,6 +421,8 @@ Rust FFI.
378421

379422
The build scripts set `LIVEKIT_BUILD_CAPTURE`. The generated numeric
380423
`LIVEKIT_CAPTURE_ENABLED` macro (0 or 1) supports `#if` checks in consumers.
424+
Direct inclusion of `livekit/capture_source.h` fails at compile time in standard
425+
SDK builds. `livekit/livekit.h` includes capture declarations only when enabled.
381426
`share/livekit/build-info.json` in an installed bundle describes the same build
382427
features; neither value tests whether a GPU or a requested GStreamer plugin is
383428
available at runtime.
@@ -386,23 +431,8 @@ Release downloads with `-capture` in their names include these features, for
386431
example `livekit-sdk-macos-arm64-capture-<version>.tar.gz`. Standard release
387432
bundles have capture disabled.
388433

389-
Building a capture-enabled SDK requires GStreamer development libraries
390-
accessible to `pkg-config`. On macOS, install both the official universal
391-
runtime and development packages from the
392-
[GStreamer downloads page](https://gstreamer.freedesktop.org/download/#macos).
393-
Add `/Library/Frameworks/GStreamer.framework/Versions/1.0/bin` to the front of
394-
`PATH` and `/Library/Frameworks/GStreamer.framework/Versions/1.0/lib/pkgconfig`
395-
to the front of `PKG_CONFIG_PATH`. These packages support both x86_64 and arm64.
396-
Use one GStreamer installation method per machine to keep its libraries and
397-
plugins consistent. On Ubuntu, install `libgstreamer1.0-dev` and
398-
`libgstreamer-plugins-base1.0-dev`, plus the runtime plugins your pipeline
399-
uses. On Windows, install the MSVC runtime and development packages from the
400-
[GStreamer downloads page](https://gstreamer.freedesktop.org/download/) and put
401-
the installation's `bin` directory on `PATH` and `lib/pkgconfig` directory on
402-
`PKG_CONFIG_PATH`.
403-
404-
Capture bundles require GStreamer at runtime, including when using pattern or
405-
clock sources. The SDK does not redistribute GStreamer libraries or plugins.
434+
See [Additional capture dependencies](#additional-capture-dependencies) before
435+
building or running a capture-enabled SDK.
406436

407437
Rust artifacts are stored under `client-sdk-rust/target/cpp-<feature-hash>/`,
408438
with separate directories for capture-enabled and disabled builds. Generated
@@ -411,67 +441,6 @@ the installed SDK instead of another configuration's most recent build.
411441

412442
See [Capture sources](capture-sources.md) for dependencies and usage.
413443

414-
## Build in a Linux container
415-
416-
You can test a clean Linux build and its dependency tree from a macOS or Linux
417-
host with `docker/linux.Dockerfile`. The container is a build check, not
418-
a development environment. The image uses Ubuntu 24.04 with the same packages
419-
as the Linux CI jobs. It also includes GStreamer for `--capture` builds and
420-
the stable Rust toolchain.
421-
422-
The container bind-mounts the source paths that the build reads from the host
423-
into `/work`. Changes on the host show up in the container immediately. The
424-
`/work` directory itself is the `lk-cpp-work` volume, so build outputs such as
425-
`build-*`, `local-install`, and `sdk-out` stay in the container. Host build
426-
directories and `.git` data are not mounted.
427-
428-
1. From the repository root, build the image. The `client-sdk-rust` submodule
429-
must be checked out, because the image copies its clang install script.
430-
431-
```bash
432-
docker build -f docker/linux.Dockerfile -t livekit-cpp-build .
433-
```
434-
435-
To install gstreamer:
436-
```bash
437-
docker build -f docker/linux.Dockerfile \
438-
--build-arg INSTALL_GSTREAMER=1 \
439-
-t livekit-cpp-build .
440-
```
441-
442-
The build context is the repository root. The file
443-
`docker/linux.Dockerfile.dockerignore` limits the context to the
444-
clang install script, so Docker does not send build outputs or `.git`.
445-
446-
2. From the repository root, start the container:
447-
448-
```bash
449-
docker run -d --name lk-cpp --network host \
450-
-v lk-cpp-work:/work \
451-
-v lk-cargo-target:/cargo-target \
452-
-v lk-cargo-registry:/opt/cargo/registry \
453-
-v "$(pwd)/build.sh:/work/build.sh" \
454-
-v "$(pwd)/CMakeLists.txt:/work/CMakeLists.txt" \
455-
-v "$(pwd)/CMakePresets.json:/work/CMakePresets.json" \
456-
-v "$(pwd)/build.h.in:/work/build.h.in" \
457-
-v "$(pwd)/.build-info.json.in:/work/.build-info.json.in" \
458-
-v "$(pwd)/cmake:/work/cmake" \
459-
-v "$(pwd)/include:/work/include" \
460-
-v "$(pwd)/src:/work/src" \
461-
-v "$(pwd)/scripts:/work/scripts" \
462-
-v "$(pwd)/client-sdk-rust:/work/client-sdk-rust" \
463-
-v lk-rust-source-target:/work/client-sdk-rust/target \
464-
-v "$(pwd)/cpp-example-collection:/work/cpp-example-collection" \
465-
livekit-cpp-build sleep infinity
466-
```
467-
468-
3. Open a shell in the container:
469-
470-
```bash
471-
docker exec -it lk-cpp bash
472-
```
473-
For a fully clean build, run `./build.sh clean-all` in the container, or remove the volumes.
474-
475444
## Support
476445

477446
- GitHub Issues: <https://github.com/livekit/client-sdk-cpp/issues>

‎docs/testing.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,11 @@ export LIVEKIT_TOKEN_B="$(lk token create --api-key devkey --api-secret secret -
103103
`src/tests/packaging/` is a standalone CMake consumer of an installed SDK.
104104
CTest registers `InstalledSdk.Capture` with the `packaging` and `integration`
105105
labels and a 30-second timeout. It checks the bundle's capture metadata and
106-
creates a GStreamer VP8 source through the installed library. It needs no
107-
LiveKit server; capture-enabled runs require GStreamer and the pipeline's plugins.
106+
creates a GStreamer VP8 source through the installed library when capture is
107+
enabled. Configuration checks that direct inclusion of `livekit/capture_source.h`
108+
succeeds for capture bundles and fails for standard bundles. Both variants must
109+
still compile with `livekit/livekit.h`. It needs no LiveKit server; capture-enabled
110+
runs require GStreamer and the pipeline's plugins.
108111
The consumer also checks `share/livekit/build-info.json`. Release jobs pass
109112
`LIVEKIT_EXPECT_VERSION` to check version metadata and the recorded Rust commit
110113
and FFI version through this same project.

‎include/livekit/capture_source.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616

1717
#pragma once
1818

19+
#include "livekit/build.h"
20+
21+
// Internal SDK wrappers are built for both variants; consumers require capture.
22+
#if !LIVEKIT_CAPTURE_ENABLED && !defined(LIVEKIT_BUILDING_SDK)
23+
#error "Capture sources require a capture-enabled LiveKit SDK; rebuild with --capture."
24+
#endif
25+
1926
#include <cstdint>
2027
#include <functional>
2128
#include <future>
@@ -24,7 +31,6 @@
2431
#include <stdexcept>
2532
#include <string>
2633

27-
#include "livekit/build.h"
2834
#include "livekit/room_event_types.h"
2935
#include "livekit/video_source.h"
3036
#include "livekit/visibility.h"

‎include/livekit/livekit.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#include "livekit/audio_source.h"
2222
#include "livekit/audio_stream.h"
2323
#include "livekit/build.h"
24+
#if LIVEKIT_CAPTURE_ENABLED
2425
#include "livekit/capture_source.h"
26+
#endif
2527
#include "livekit/e2ee.h"
2628
#include "livekit/encoded_video_source.h"
2729
#include "livekit/local_audio_track.h"

0 commit comments

Comments
 (0)