Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4698605
test(livekit-ffi): pin the data track request surface before migration
1egoman Nov 1, 2026
66272aa
build(livekit-ffi): depend on livekit-datatrack and livekit-common in…
1egoman Nov 1, 2026
53aa494
refactor(livekit-ffi): hoist the data track objects out of core-modules
1egoman Nov 1, 2026
6594cea
refactor(livekit-ffi): rename core-modules' data_track to data_track_…
1egoman Nov 1, 2026
5a1cd7a
build(livekit-ffi): keep the Python bindings importable as flat files
1egoman Nov 1, 2026
df22d54
refactor(livekit-ffi): give the shared data tracks a room-apis handle id
1egoman Nov 1, 2026
a6f330a
feat(livekit-ffi): bridge the data tracks between the FFI handle map …
1egoman Nov 1, 2026
0a25549
refactor(livekit-ffi): store data tracks in the handle map as the uni…
1egoman Nov 1, 2026
188346e
docs(livekit-ffi): document data track co-ownership across the FFI su…
1egoman Nov 1, 2026
ecea208
docs(livekit-ffi): drop the data track co-ownership and dependency co…
1egoman Nov 1, 2026
9b0df2f
build(livekit-ffi): leave the Python bindings' imports relative
1egoman Nov 1, 2026
a50b934
refactor(livekit-ffi): inline the data track _ffi methods into the re…
1egoman Nov 2, 2026
62e7512
refactor(livekit-ffi): keep the shared data tracks' fields private
1egoman Nov 2, 2026
98498be
refactor: drop extra variable assignment
1egoman Nov 2, 2026
e1a8c38
refactor(livekit-ffi): move the runtime accessor to the crate root
1egoman Nov 9, 2026
37fbaef
feat(livekit-ffi): add close() to DataTrackStream
1egoman Nov 17, 2026
b1648dd
test(livekit-ffi): pin the data stream request surface before migration
1egoman Nov 9, 2026
b5a7af8
build(livekit-ffi): depend on livekit-data-stream and tokio-util in b…
1egoman Nov 9, 2026
e14a280
refactor(livekit-ffi): hoist the data stream objects out of core-modules
1egoman Nov 9, 2026
083d6c3
refactor(livekit-ffi): rename core-modules' data_stream to data_strea…
1egoman Nov 9, 2026
d364db5
ci(livekit-ffi): check the Python bindings export the data stream obj…
1egoman Nov 9, 2026
a43ca39
refactor(livekit-ffi): give the shared data stream objects a room-api…
1egoman Nov 9, 2026
224ac73
feat(livekit-ffi): bridge the data stream objects between the FFI han…
1egoman Nov 9, 2026
e8fb536
refactor(livekit-ffi): store data stream readers and writers as the u…
1egoman Nov 9, 2026
5605b28
chore(livekit-ffi): add a changeset for the shared data stream objects
1egoman Nov 9, 2026
715b7eb
refactor(livekit-ffi): alias livekit_data_stream::api as data_stream_api
1egoman Nov 19, 2026
b72f801
docs(livekit-ffi): trim the PacketDeliveryError doc comment
1egoman Nov 19, 2026
81a911e
refactor(livekit-ffi): alias livekit_data_stream::backend as data_stream
1egoman Nov 19, 2026
0b2f40c
refactor(livekit-ffi): import the server data_stream module as data_s…
1egoman Nov 19, 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
5 changes: 5 additions & 0 deletions .changeset/data_streams_shared_uniffi_objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
livekit-ffi: patch
---

Expose the data stream readers and writers (`ByteStreamReader`, `TextStreamReader`, `ByteStreamWriter`, `TextStreamWriter`) over UniFFI in room-apis builds too, as the same objects core-modules exports. A reader or writer handle from the C ABI (`OwnedByteStreamReader`, `OwnedTextStreamWriter`, ...) can be taken up with `from_ffi_handle_id` and handed back with `ffi_handle_id`, as with data tracks; the protobuf request surface is unchanged.
5 changes: 5 additions & 0 deletions .changeset/data_tracks_shared_uniffi_objects.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
livekit-ffi: patch
---

Expose `LocalDataTrack`, `RemoteDataTrack` and `DataTrackStream` over UniFFI in room-apis builds too, as the same objects core-modules exports. A track handle from the C ABI (`OwnedLocalDataTrack`, `OwnedRemoteDataTrack`) can be taken up with `from_ffi_handle_id` and handed back with `ffi_handle_id`, as with `SoxResampler`; the protobuf request surface is unchanged. A local track taken up over UniFFI is co-owned: dropping its C ABI handle no longer unpublishes it while the UniFFI side still holds it. `DataTrackStream` gains `close()`, which wakes a pending `next()` with `None` and drops the stream, so a subscription can be ended while a read is in flight.
2 changes: 2 additions & 0 deletions .github/workflows/ffi-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,8 @@ jobs:
# no metadata, so assert on the output instead of the exit code.
test -s python-bindings/livekit_ffi.py
grep -q 'def build_version' python-bindings/livekit_ffi.py
grep -q 'class LocalDataTrack' python-bindings/livekit_ffi.py
grep -q 'class ByteStreamReader' python-bindings/livekit_ffi.py

- name: Zip Python bindings
if: ${{ matrix.name == 'ffi-macos-arm64' }}
Expand Down
18 changes: 8 additions & 10 deletions livekit-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,12 @@ room-apis = [
# downstream language and is a transitional step to migrating eventually someday to the full
# room-apis mode - swift, android, flutter, etc.
core-modules = [
"dep:livekit-common",
"dep:livekit-data-stream",
"dep:livekit-datatrack",
"dep:livekit-net",
"dep:livekit-signaling",
"dep:livekit-token",
"dep:prost",
"dep:async-trait",
"dep:once_cell",
"dep:tokio-util",
"livekit-common/uniffi",
"livekit-datatrack/uniffi",
"livekit-net/uniffi",
"uniffi/tokio",
]
Expand All @@ -78,6 +72,10 @@ capture-clock = ["capture", "livekit-capture/source-clock"]
capture-gstreamer = ["capture", "livekit-capture/source-gstreamer"]
capture-pattern = ["capture", "livekit-capture/source-pattern"]

# End-to-end tests against a LiveKit server, as in the `livekit` crate. These
# drive the room-apis request surface, so they imply it.
__lk-e2e-test = ["room-apis"]

[dependencies]
# Shared by both surfaces.
livekit-protocol = { workspace = true }
Expand All @@ -87,22 +85,22 @@ futures-util = { workspace = true, default-features = false, features = ["sink"]
bytes = { workspace = true }
log = { workspace = true }
thiserror = { workspace = true }
livekit-common = { workspace = true, features = ["uniffi"] }
livekit-datatrack = { workspace = true, features = ["uniffi"] }
livekit-data-stream = { workspace = true }
tokio-util = { workspace = true }

# room-apis only. Each of these is referenced solely from the `room_apis` module
# tree, so gating them costs no source changes.
livekit = { workspace = true, optional = true }
livekit-capture = { workspace = true, optional = true, default-features = false }

# core-modules only.
livekit-common = { workspace = true, optional = true }
livekit-token = { workspace = true, optional = true }
livekit-datatrack = { workspace = true, optional = true }
livekit-net = { workspace = true, optional = true }
livekit-data-stream = { workspace = true, optional = true }
# Default features, so the signalling client stays transport-blind and uses
# whatever the host registered with livekit-net.
livekit-signaling = { workspace = true, optional = true }
tokio-util = { workspace = true, optional = true }
once_cell = { version = "1.21.3", optional = true }
async-trait = { version = "0.1", optional = true }

Expand Down
File renamed without changes.
Loading