Skip to content

Commit f600b38

Browse files
adding single peer connection support (#57)
* adding single peer connection support * update client-sdk-rust
1 parent 7c906d2 commit f600b38

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

client-sdk-rust

include/livekit/room.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ struct RoomOptions {
7373
// Enable dynacast (server sends optimal layers depending on subscribers).
7474
bool dynacast = false;
7575

76+
// Enable single peer connection mode. When true, uses one RTCPeerConnection
77+
// for both publishing and subscribing instead of two separate connections.
78+
// Falls back to dual peer connection if the server doesn't support single PC.
79+
bool single_peer_connection = true;
80+
7681
// Optional WebRTC configuration (ICE policy, servers, etc.)
7782
std::optional<RtcConfig> rtc_config;
7883

src/ffi_client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ FfiClient::connectAsync(const std::string &url, const std::string &token,
317317
auto *opts = connect->mutable_options();
318318
opts->set_auto_subscribe(options.auto_subscribe);
319319
opts->set_dynacast(options.dynacast);
320+
opts->set_single_peer_connection(options.single_peer_connection);
320321
// --- E2EE / encryption (optional) ---
321322
if (options.encryption.has_value()) {
322323
const E2EEOptions &e2ee = *options.encryption;

0 commit comments

Comments
 (0)