You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8f570b7
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: AGENTS.md
+29-3Lines changed: 29 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,15 +40,15 @@ When making larger scale changes, check with the developer before committing to
40
40
41
41
The SDK has three categories of threads:
42
42
43
-
**FFI callback thread** — The Rust FFI layer calls `LivekitFfiCallback` from a Rust-managed thread (typically a Tokio runtime thread). This single entry point deserializes the `FfiEvent` and calls `FfiClient::PushEvent`, which:
43
+
**FFI callback thread** — The Rust FFI layer calls `LivekitFfiCallback` from a Rust-managed thread (typically a Tokio runtime thread). This single entry point deserializes the `FfiEvent` and calls `FfiClient::pushEvent`, which:
44
44
1. Completes any pending async `std::promise` matched by `async_id`.
45
-
2. Invokes all registered `FfiClient` listeners (including `Room::OnEvent`).
45
+
2. Invokes all registered `FfiClient` listeners (including `Room::onEvent`).
46
46
47
47
All `RoomDelegate` callbacks and stream handler callbacks (e.g., `registerTextStreamHandler`) are invoked on this FFI callback thread. **Handlers must not block**; spawn a background thread if synchronous work is needed.
48
48
49
49
**Per-subscription reader threads** — `SubscriptionThreadDispatcher` creates a dedicated `std::thread` for each active audio, video, or data track subscription. These threads block on `AudioStream::read()`, `VideoStream::read()`, or `DataTrackStream::read()` and invoke the registered `AudioFrameCallback`, `VideoFrameCallback`, or `DataFrameCallback` on that reader thread — not on the FFI callback thread. A hard limit of 20 concurrent reader threads is enforced.
50
50
51
-
**Application threads** — The calling thread for public API methods such as `Room::Connect`, `LocalParticipant::publishTrack`, `AudioSource::captureFrame`, etc. These may block while waiting for FFI responses or future completion.
51
+
**Application threads** — The calling thread for public API methods such as `Room::connect`, `LocalParticipant::publishTrack`, `AudioSource::captureFrame`, etc. These may block while waiting for FFI responses or future completion.
52
52
53
53
#### Thread-safety guarantees
54
54
@@ -146,6 +146,32 @@ All source files must have the LiveKit Apache 2.0 copyright header. Use the curr
146
146
-`lk_log.h` lives under `src/` (internal). The public-facing logging API is `include/livekit/logging.h`.
147
147
- spdlog must not appear in any public header or installed header.
148
148
149
+
#### Deprecating a public API
150
+
151
+
When superseding a public API (renaming, replacing, or removing in a future major
152
+
version), every retained back-compat shim must carry **both** annotations:
153
+
154
+
1. The C++11 `[[deprecated("...")]]` attribute so the compiler warns at every
155
+
call site. The message should name the replacement (e.g.
156
+
`"AudioFrame::sample_rate is deprecated; use AudioFrame::sampleRate instead"`).
157
+
2. A Doxygen `/// @deprecated Use <newName>() instead.` line immediately above
158
+
the attribute so the generated docs render a deprecation callout and add the
159
+
symbol to Doxygen's auto-generated *Deprecated List* page. Doxygen does not
160
+
read the C++ attribute, so this line is required even though it duplicates
161
+
information.
162
+
163
+
Example:
164
+
165
+
```cpp
166
+
/// @deprecated Use sampleRate() instead.
167
+
[[deprecated("AudioFrame::sample_rate is deprecated; use AudioFrame::sampleRate instead")]]
0 commit comments