Commit 5c0d922
committed
feat: port data streams to the livekit-ffi rust implementation
Replaces the hand-rolled Python data streams (client-side header/chunk/trailer
framing over SendStreamHeader/Chunk/TrailerRequest) with the FFI's native
implementation (data streams v2: single-packet streams + deflate):
- Writers open handle-based FFI streams (text/byte_stream_open/write/close);
chunking, stream ids, and compression now happen in rust
- send_text/send_file are one-shot FFI calls and gain a compress option
- Incoming streams arrive via text/byte_stream_opened room events; readers
consume per-handle reader events after a read_incremental request, and
unhandled topics dispose the owned reader handle
- New public API: StreamError (raised when a stream terminates abnormally,
previously indistinguishable from clean EOS) and
RoomOptions.data_stream/DataStreamOptions.max_payload_byte_length
- Drops the use_legacy_client_implementation override, so data streams v2
support is advertised to other clients
The consumer-facing API is unchanged. Behavior changes: read errors now raise
StreamError, stream ids are rust-generated unless supplied, sender_identity is
honored consistently (was ignored for chunks/trailers), and trailers of
targeted streams are no longer broadcast room-wide.1 parent b591881 commit 5c0d922
5 files changed
Lines changed: 900 additions & 278 deletions
File tree
- livekit-rtc/livekit/rtc
- tests/rtc
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
172 | 174 | | |
173 | 175 | | |
174 | 176 | | |
| 177 | + | |
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| |||
217 | 220 | | |
218 | 221 | | |
219 | 222 | | |
| 223 | + | |
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
| |||
0 commit comments