Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d70a8de
Point submodule to ladvoc/livekit-capture
ladvoc Jul 29, 2026
691c81f
Define VideoCodec and add video_encoder publish option
ladvoc Jul 30, 2026
d59ec72
Add capture protos and LIVEKIT_ENABLE_CAPTURE option
ladvoc Jul 30, 2026
5e481d8
Add capture source requests to FfiClient
ladvoc Jul 30, 2026
4484f37
Add CaptureSource wrapper
ladvoc Jul 30, 2026
c6f0fa8
Add capture source integration test
ladvoc Jul 30, 2026
2a9375f
scoped lock
stephen-derosa Jul 31, 2026
592ab3b
working in CI
stephen-derosa Jul 31, 2026
aea2e0f
required resolution and explicit demo characteristics
stephen-derosa Aug 3, 2026
6fc46ab
livekit capture: device
stephen-derosa Aug 4, 2026
57e6fe9
PatternVideoSourceConfig
stephen-derosa Aug 11, 2026
1cfd4db
note
stephen-derosa Aug 25, 2026
2816373
clarifying comment on gstreamer version
stephen-derosa Aug 25, 2026
44c6a76
upper case enum alignment
stephen-derosa Aug 25, 2026
a70378f
update comments
stephen-derosa Aug 25, 2026
2378c84
complete doxygen
stephen-derosa Aug 25, 2026
f0861e1
complete doxygen
stephen-derosa Aug 25, 2026
e4bb683
no more optional
stephen-derosa Aug 25, 2026
48a93da
internal api converter
stephen-derosa Aug 25, 2026
0c4a556
rm unneeded local var
stephen-derosa Aug 25, 2026
bffaafd
start/stop return bool
stephen-derosa Aug 25, 2026
c0c4c3c
use public header
stephen-derosa Aug 25, 2026
cbbc4ed
fix deps
stephen-derosa Aug 25, 2026
06723f5
rust hash
stephen-derosa Aug 25, 2026
9c799e0
dep on libjpeg
stephen-derosa Aug 25, 2026
ab2cf8f
pass clang for macro
stephen-derosa Aug 25, 2026
cdff6dc
rust hash
stephen-derosa Aug 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 45 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ env:
VCPKG_DEFAULT_TRIPLET: x64-windows-static-md
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-md
VCPKG_TARGET_TRIPLET: x64-windows-static-md
# Windows uses an explicit, checksum-pinned GStreamer SDK. Linux and macOS
# intentionally use their supported platform-package versions; `1.0` in
# Ubuntu package names denotes the GStreamer ABI, not the installed release.
GSTREAMER_WINDOWS_VERSION: "1.28.5"
GSTREAMER_WINDOWS_SHA256: "51ee5eaec33008e8409d8cf6f6884457f22aa3bd515f8856f993a3eaab903530"

jobs:
test:
Expand Down Expand Up @@ -209,6 +214,34 @@ jobs:
with:
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT }}

- name: Install GStreamer (Windows)
if: runner.os == 'Windows'
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

# ---------- OS-specific deps ----------
- name: Install deps (Ubuntu)
if: runner.os == 'Linux'
Expand All @@ -227,14 +260,19 @@ jobs:
libabsl-dev \
libcurl4-openssl-dev \
libwayland-dev libdecor-0-dev \
libunwind-dev libjpeg-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Help me understand the difference in versions between these installs and the one at the top of this file for Windows? 1.0-dev vs. 1.28.5? Just making sure no surprises

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callout, I added a clarifying comment. Effectively we are doing this to ensure we go through through each platform’s native package mechanism (linux/mac use latest whereas windows uses an explicit pinned version).

gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
gstreamer1.0-libav \
gdb jq

- name: Install deps (macOS)
if: runner.os == 'macOS'
run: |
set -eux
brew update
brew install cmake ninja protobuf abseil
brew install cmake ninja protobuf abseil gstreamer

# ---------- Rust toolchain ----------
- name: Install Rust (stable)
Expand Down Expand Up @@ -508,7 +546,12 @@ jobs:
libprotobuf-dev protobuf-compiler \
libabsl-dev \
libcurl4-openssl-dev \
libwayland-dev libdecor-0-dev
libwayland-dev libdecor-0-dev \
libunwind-dev libjpeg-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
pip install --break-system-packages gcovr

# ---------- Rust toolchain ----------
Expand Down
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ include(warnings)

option(LIVEKIT_BUILD_EXAMPLES "Build LiveKit examples" OFF)
option(LIVEKIT_BUILD_TESTS "Build LiveKit tests" OFF)
option(LIVEKIT_ENABLE_CAPTURE "Build the Rust FFI with the capture feature (livekit-capture sources; links system GStreamer)" OFF)

# vcpkg is only used on Windows; Linux/macOS use system package managers
if(WIN32)
Expand Down Expand Up @@ -85,6 +86,7 @@ set(FFI_PROTO_FILES
${FFI_PROTO_DIR}/data_track.proto
${FFI_PROTO_DIR}/rpc.proto
${FFI_PROTO_DIR}/track_publication.proto
${FFI_PROTO_DIR}/capture.proto
)
set(PROTO_BINARY_DIR ${LIVEKIT_BINARY_DIR}/generated)
file(MAKE_DIRECTORY ${PROTO_BINARY_DIR})
Expand Down Expand Up @@ -166,6 +168,14 @@ set(GENERATED_BUILD_H "${LIVEKIT_ROOT_DIR}/include/livekit/build.h")
set(GENERATED_BUILD_INFO_JSON "${LIVEKIT_BINARY_DIR}/build-info.json")
set(RUST_ROOT ${LIVEKIT_ROOT_DIR}/client-sdk-rust)

# Cargo features for the Rust FFI build.
set(LIVEKIT_CARGO_FEATURES "")
set(LIVEKIT_CAPTURE_ENABLED 0)
if(LIVEKIT_ENABLE_CAPTURE)
set(LIVEKIT_CARGO_FEATURES "capture")
set(LIVEKIT_CAPTURE_ENABLED 1)
endif()

set(GIT_COMMIT "unknown")
set(RUST_GIT_COMMIT "unknown")
find_package(Git QUIET)
Expand Down Expand Up @@ -261,6 +271,11 @@ if(NOT CFG STREQUAL \"Debug\")
list(APPEND ARGS --release)
endif()

if(DEFINED CARGO_FEATURES AND NOT CARGO_FEATURES STREQUAL \"\")
list(APPEND ARGS --features \"\${CARGO_FEATURES}\")
message(STATUS \"[run_cargo.cmake] Cargo features: \${CARGO_FEATURES}\")
endif()

if(DEFINED RUST_TARGET AND NOT RUST_TARGET STREQUAL \"\")
list(APPEND ARGS --target \"\${RUST_TARGET}\")
message(STATUS \"[run_cargo.cmake] Cross-compiling for target: \${RUST_TARGET}\")
Expand Down Expand Up @@ -357,6 +372,7 @@ add_custom_command(
-DPROTOC_PATH=${Protobuf_PROTOC_EXECUTABLE}
-DRUST_TARGET=${RUST_TARGET_TRIPLE}
-DGCC_LIB_DIR=${GCC_LIB_DIR}
-DCARGO_FEATURES=${LIVEKIT_CARGO_FEATURES}
-P "${RUN_CARGO_SCRIPT}"
WORKING_DIRECTORY "${RUST_ROOT}"
DEPENDS ${RUST_SOURCES}
Expand All @@ -373,6 +389,8 @@ add_custom_target(build_rust_ffi
add_library(livekit SHARED
src/audio_frame.cpp
src/audio_processing_module.cpp
src/capture_source.cpp
src/capture_source_internal.h
src/audio_source.cpp
src/audio_stream.cpp
src/data_track_frame.cpp
Expand Down
36 changes: 24 additions & 12 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -226,7 +227,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -238,7 +240,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -250,7 +253,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -262,7 +266,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -274,7 +279,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -286,7 +292,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -298,7 +305,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -310,7 +318,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -322,7 +331,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "ON",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -334,7 +344,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
},
{
Expand All @@ -346,7 +357,8 @@
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"LIVEKIT_BUILD_EXAMPLES": "OFF",
"LIVEKIT_BUILD_TESTS": "ON"
"LIVEKIT_BUILD_TESTS": "ON",
"LIVEKIT_ENABLE_CAPTURE": "ON"
}
}
],
Expand Down
17 changes: 12 additions & 5 deletions build.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,23 @@

// Version injected by CMake (CI should set it). Defaults to 0.0.0 for dev builds.
#define LIVEKIT_BUILD_VERSION "@LIVEKIT_VERSION@"
#define LIVEKIT_BUILD_FLAVOR "cpp"
#define LIVEKIT_BUILD_FLAVOR "cpp"

namespace livekit {

/// @brief Whether the Rust FFI was built with capture-source support.
inline constexpr bool kCaptureEnabled = "@LIVEKIT_CAPTURE_ENABLED@"[0] == '1';

} // namespace livekit

#ifdef DEBUG
#define LIVEKIT_BUILD_SUFFIX "-debug"
#define LIVEKIT_BUILD_SUFFIX "-debug"
#else
#define LIVEKIT_BUILD_SUFFIX "-release"
#define LIVEKIT_BUILD_SUFFIX "-release"
#endif

// Follow params are auto generated by CMakeLists.txt
#define LIVEKIT_BUILD_DATE "@BUILD_DATE@"
#define LIVEKIT_BUILD_DATE "@BUILD_DATE@"
#define LIVEKIT_BUILD_COMMIT "@GIT_COMMIT@"

#define LIVEKIT_BUILD_VERSION_FULL LIVEKIT_BUILD_VERSION LIVEKIT_BUILD_SUFFIX
#define LIVEKIT_BUILD_VERSION_FULL LIVEKIT_BUILD_VERSION LIVEKIT_BUILD_SUFFIX
2 changes: 1 addition & 1 deletion client-sdk-rust
Loading
Loading