Skip to content

Commit 592ab3b

Browse files
working in CI
1 parent 2a9375f commit 592ab3b

5 files changed

Lines changed: 130 additions & 108 deletions

File tree

‎.github/workflows/tests.yml‎

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ env:
132132
VCPKG_DEFAULT_TRIPLET: x64-windows-static-md
133133
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows-static-md
134134
VCPKG_TARGET_TRIPLET: x64-windows-static-md
135+
# The Windows GStreamer bundle is pinned and checksum-verified below. Linux
136+
# and macOS use their platform package managers.
137+
GSTREAMER_WINDOWS_VERSION: "1.28.5"
138+
GSTREAMER_WINDOWS_SHA256: "51ee5eaec33008e8409d8cf6f6884457f22aa3bd515f8856f993a3eaab903530"
135139

136140
jobs:
137141
test:
@@ -209,6 +213,34 @@ jobs:
209213
with:
210214
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT }}
211215

216+
- name: Install GStreamer (Windows)
217+
if: runner.os == 'Windows'
218+
shell: pwsh
219+
run: |
220+
$installer = Join-Path $env:RUNNER_TEMP "gstreamer-installer.exe"
221+
$installDir = Join-Path $env:RUNNER_TEMP "gstreamer"
222+
$uri = "https://gstreamer.freedesktop.org/data/pkg/windows/$env:GSTREAMER_WINDOWS_VERSION/msvc/gstreamer-1.0-msvc-x86_64-$env:GSTREAMER_WINDOWS_VERSION.exe"
223+
224+
Invoke-WebRequest -Uri $uri -OutFile $installer
225+
$actualHash = (Get-FileHash -Algorithm SHA256 $installer).Hash.ToLowerInvariant()
226+
if ($actualHash -ne $env:GSTREAMER_WINDOWS_SHA256) {
227+
throw "GStreamer installer SHA-256 mismatch: expected $env:GSTREAMER_WINDOWS_SHA256, got $actualHash"
228+
}
229+
230+
$process = Start-Process -FilePath $installer -ArgumentList @(
231+
"/TYPE=devel",
232+
"/DIR=$installDir",
233+
"/CURRENTUSER",
234+
"/VERYSILENT",
235+
"/NORESTART"
236+
) -Wait -PassThru
237+
if ($process.ExitCode -ne 0) {
238+
throw "GStreamer installer failed with exit code $($process.ExitCode)"
239+
}
240+
241+
"$installDir\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
242+
"PKG_CONFIG_PATH=$installDir\lib\pkgconfig" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
243+
212244
# ---------- OS-specific deps ----------
213245
- name: Install deps (Ubuntu)
214246
if: runner.os == 'Linux'
@@ -227,14 +259,18 @@ jobs:
227259
libabsl-dev \
228260
libcurl4-openssl-dev \
229261
libwayland-dev libdecor-0-dev \
262+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
263+
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
264+
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
265+
gstreamer1.0-libav \
230266
gdb jq
231267
232268
- name: Install deps (macOS)
233269
if: runner.os == 'macOS'
234270
run: |
235271
set -eux
236272
brew update
237-
brew install cmake ninja protobuf abseil
273+
brew install cmake ninja protobuf abseil gstreamer
238274
239275
# ---------- Rust toolchain ----------
240276
- name: Install Rust (stable)
@@ -508,7 +544,11 @@ jobs:
508544
libprotobuf-dev protobuf-compiler \
509545
libabsl-dev \
510546
libcurl4-openssl-dev \
511-
libwayland-dev libdecor-0-dev
547+
libwayland-dev libdecor-0-dev \
548+
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
549+
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
550+
gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly \
551+
gstreamer1.0-libav
512552
pip install --break-system-packages gcovr
513553
514554
# ---------- Rust toolchain ----------

‎CMakePresets.json‎

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,8 @@
214214
"cacheVariables": {
215215
"CMAKE_BUILD_TYPE": "Release",
216216
"LIVEKIT_BUILD_EXAMPLES": "ON",
217-
"LIVEKIT_BUILD_TESTS": "ON"
217+
"LIVEKIT_BUILD_TESTS": "ON",
218+
"LIVEKIT_ENABLE_CAPTURE": "ON"
218219
}
219220
},
220221
{
@@ -226,7 +227,8 @@
226227
"cacheVariables": {
227228
"CMAKE_BUILD_TYPE": "Debug",
228229
"LIVEKIT_BUILD_EXAMPLES": "ON",
229-
"LIVEKIT_BUILD_TESTS": "ON"
230+
"LIVEKIT_BUILD_TESTS": "ON",
231+
"LIVEKIT_ENABLE_CAPTURE": "ON"
230232
}
231233
},
232234
{
@@ -238,7 +240,8 @@
238240
"cacheVariables": {
239241
"CMAKE_BUILD_TYPE": "Release",
240242
"LIVEKIT_BUILD_EXAMPLES": "OFF",
241-
"LIVEKIT_BUILD_TESTS": "ON"
243+
"LIVEKIT_BUILD_TESTS": "ON",
244+
"LIVEKIT_ENABLE_CAPTURE": "ON"
242245
}
243246
},
244247
{
@@ -250,7 +253,8 @@
250253
"cacheVariables": {
251254
"CMAKE_BUILD_TYPE": "Debug",
252255
"LIVEKIT_BUILD_EXAMPLES": "OFF",
253-
"LIVEKIT_BUILD_TESTS": "ON"
256+
"LIVEKIT_BUILD_TESTS": "ON",
257+
"LIVEKIT_ENABLE_CAPTURE": "ON"
254258
}
255259
},
256260
{
@@ -262,7 +266,8 @@
262266
"cacheVariables": {
263267
"CMAKE_BUILD_TYPE": "Release",
264268
"LIVEKIT_BUILD_EXAMPLES": "ON",
265-
"LIVEKIT_BUILD_TESTS": "ON"
269+
"LIVEKIT_BUILD_TESTS": "ON",
270+
"LIVEKIT_ENABLE_CAPTURE": "ON"
266271
}
267272
},
268273
{
@@ -274,7 +279,8 @@
274279
"cacheVariables": {
275280
"CMAKE_BUILD_TYPE": "Debug",
276281
"LIVEKIT_BUILD_EXAMPLES": "ON",
277-
"LIVEKIT_BUILD_TESTS": "ON"
282+
"LIVEKIT_BUILD_TESTS": "ON",
283+
"LIVEKIT_ENABLE_CAPTURE": "ON"
278284
}
279285
},
280286
{
@@ -286,7 +292,8 @@
286292
"cacheVariables": {
287293
"CMAKE_BUILD_TYPE": "Release",
288294
"LIVEKIT_BUILD_EXAMPLES": "OFF",
289-
"LIVEKIT_BUILD_TESTS": "ON"
295+
"LIVEKIT_BUILD_TESTS": "ON",
296+
"LIVEKIT_ENABLE_CAPTURE": "ON"
290297
}
291298
},
292299
{
@@ -298,7 +305,8 @@
298305
"cacheVariables": {
299306
"CMAKE_BUILD_TYPE": "Debug",
300307
"LIVEKIT_BUILD_EXAMPLES": "OFF",
301-
"LIVEKIT_BUILD_TESTS": "ON"
308+
"LIVEKIT_BUILD_TESTS": "ON",
309+
"LIVEKIT_ENABLE_CAPTURE": "ON"
302310
}
303311
},
304312
{
@@ -310,7 +318,8 @@
310318
"cacheVariables": {
311319
"CMAKE_BUILD_TYPE": "Release",
312320
"LIVEKIT_BUILD_EXAMPLES": "ON",
313-
"LIVEKIT_BUILD_TESTS": "ON"
321+
"LIVEKIT_BUILD_TESTS": "ON",
322+
"LIVEKIT_ENABLE_CAPTURE": "ON"
314323
}
315324
},
316325
{
@@ -322,7 +331,8 @@
322331
"cacheVariables": {
323332
"CMAKE_BUILD_TYPE": "Debug",
324333
"LIVEKIT_BUILD_EXAMPLES": "ON",
325-
"LIVEKIT_BUILD_TESTS": "ON"
334+
"LIVEKIT_BUILD_TESTS": "ON",
335+
"LIVEKIT_ENABLE_CAPTURE": "ON"
326336
}
327337
},
328338
{
@@ -334,7 +344,8 @@
334344
"cacheVariables": {
335345
"CMAKE_BUILD_TYPE": "Release",
336346
"LIVEKIT_BUILD_EXAMPLES": "OFF",
337-
"LIVEKIT_BUILD_TESTS": "ON"
347+
"LIVEKIT_BUILD_TESTS": "ON",
348+
"LIVEKIT_ENABLE_CAPTURE": "ON"
338349
}
339350
},
340351
{
@@ -346,7 +357,8 @@
346357
"cacheVariables": {
347358
"CMAKE_BUILD_TYPE": "Debug",
348359
"LIVEKIT_BUILD_EXAMPLES": "OFF",
349-
"LIVEKIT_BUILD_TESTS": "ON"
360+
"LIVEKIT_BUILD_TESTS": "ON",
361+
"LIVEKIT_ENABLE_CAPTURE": "ON"
350362
}
351363
}
352364
],

‎include/livekit/capture_source.h‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,27 +143,25 @@ class LIVEKIT_API CaptureSource {
143143
public:
144144
/// Terminal notification for a started capture, invoked exactly once on
145145
/// the FFI event thread (like room delegate callbacks).
146-
using FinishedCallback = std::function<void(const CaptureResult &)>;
146+
using FinishedCallback = std::function<void(const CaptureResult&)>;
147147

148148
/// Create a capture source from a GStreamer pipeline configuration.
149149
///
150150
/// Completes asynchronously: construction starts the pipeline and may wait
151151
/// for its first output to discover stream settings. Errors (invalid
152152
/// pipeline, missing capture feature, discovery timeout) are thrown from
153153
/// the future as @ref CaptureSourceError.
154-
static std::future<std::shared_ptr<CaptureSource>>
155-
create(GstreamerVideoSourceConfig config);
154+
static std::future<std::shared_ptr<CaptureSource>> create(GstreamerVideoSourceConfig config);
156155

157156
/// Create the built-in demo capture source (solid cycling colors).
158-
static std::future<std::shared_ptr<CaptureSource>>
159-
create(DemoVideoSourceConfig config);
157+
static std::future<std::shared_ptr<CaptureSource>> create(DemoVideoSourceConfig config);
160158

161159
~CaptureSource();
162160

163-
CaptureSource(const CaptureSource &) = delete;
164-
CaptureSource &operator=(const CaptureSource &) = delete;
165-
CaptureSource(CaptureSource &&) = delete;
166-
CaptureSource &operator=(CaptureSource &&) = delete;
161+
CaptureSource(const CaptureSource&) = delete;
162+
CaptureSource& operator=(const CaptureSource&) = delete;
163+
CaptureSource(CaptureSource&&) = delete;
164+
CaptureSource& operator=(CaptureSource&&) = delete;
167165

168166
/// Kind of media this source produces.
169167
CaptureSourceKind kind() const noexcept { return kind_; }
@@ -177,9 +175,7 @@ class LIVEKIT_API CaptureSource {
177175

178176
/// RTC video source fed by this capture source; use it with
179177
/// LocalVideoTrack::createLocalVideoTrack().
180-
std::shared_ptr<VideoSource> videoSource() const noexcept {
181-
return video_source_;
182-
}
178+
std::shared_ptr<VideoSource> videoSource() const noexcept { return video_source_; }
183179

184180
/// Returns publish options for this track, applying application options.
185181
///
@@ -210,12 +206,10 @@ class LIVEKIT_API CaptureSource {
210206

211207
/// Shared creation path: sends the request and maps the callback payload
212208
/// onto a wrapper instance.
213-
static std::future<std::shared_ptr<CaptureSource>>
214-
createFromRequest(proto::NewCaptureSourceRequest request);
209+
static std::future<std::shared_ptr<CaptureSource>> createFromRequest(proto::NewCaptureSourceRequest request);
215210

216211
/// Builds the wrapper from the callback payload, adopting its handles.
217-
static std::shared_ptr<CaptureSource>
218-
fromOwned(const proto::OwnedCaptureSource &owned);
212+
static std::shared_ptr<CaptureSource> fromOwned(const proto::OwnedCaptureSource& owned);
219213

220214
FfiHandle handle_;
221215
CaptureSourceKind kind_ = CaptureSourceKind::Pixel;

0 commit comments

Comments
 (0)