added Single Peer Connection support to Rust#888
added Single Peer Connection support to Rust#888xianshijing-lk wants to merge 9 commits intomainfrom
Conversation
livekit/src/room/mod.rs
Outdated
| @@ -1059,6 +1066,35 @@ impl RoomSession { | |||
| track_id = stream_id.into(); | |||
There was a problem hiding this comment.
nitpick: This could be moved into the else block below.
livekit/src/room/mod.rs
Outdated
| return; | ||
| } | ||
| // In dual PC mode: answer is local, offer is remote | ||
| (remote_desc.unwrap(), Some(local_desc.unwrap())) |
There was a problem hiding this comment.
question: Is it possible for sync state to be requested at a time when the subscriber PC lacks a local or remote description? If yes or it is unclear, we should avoid unwrapping here, and instead log a warning.
There was a problem hiding this comment.
Good point, I actually don't know if it is possible, but I think it is dangerous to do unwrap() here, let me address it.
| }; | ||
|
|
||
| // Create ClientInfo | ||
| let client_info = proto::ClientInfo { |
There was a problem hiding this comment.
nitpick: Spreading ..Default::default() would be cleaner here:
let client_info = proto::ClientInfo {
sdk: proto::client_info::Sdk::Rust as i32,
version: options.sdk_options.sdk_version.clone().unwrap_or_default(),
protocol: PROTOCOL_VERSION as i32,
os: std::env::consts::OS.to_string(),
client_protocol: 1, // Indicates support for RPC compression
..Default::default()
};Same for the other protobuf types below where we set an empty string or Option::None.
ladvoc
left a comment
There was a problem hiding this comment.
It looking good so far! Before merging, I think it's important to test various reconnect scenarios, as this change could potentially break them.
…n) signaling, add tests
69d4597 to
a13c540
Compare
xianshijing-lk
left a comment
There was a problem hiding this comment.
I addressed all the comments, please take another look
| }; | ||
|
|
||
| // Create ClientInfo | ||
| let client_info = proto::ClientInfo { |
livekit/src/room/mod.rs
Outdated
| @@ -1059,6 +1066,35 @@ impl RoomSession { | |||
| track_id = stream_id.into(); | |||
livekit/src/room/mod.rs
Outdated
| return; | ||
| } | ||
| // In dual PC mode: answer is local, offer is remote | ||
| (remote_desc.unwrap(), Some(local_desc.unwrap())) |
There was a problem hiding this comment.
Good point, I actually don't know if it is possible, but I think it is dangerous to do unwrap() here, let me address it.
20a520d to
3b29452
Compare
|
Hi team, thanks for the comments, I think I addressed them, please take another look. Thanks. |
|
A gentle ping. do we have concerns on landing this PR ? |
d3001b0 to
cf74f4b
Compare
|
I made some small improvements to make sure the munging code only kicks in for v1 path, and added some more tests to e2e peer connection tests |
… not support v1 by default
7454be0 to
630f41b
Compare
b25162e to
9cf6d3b
Compare
after setting the LIVEKIT_URL, LIVEKIT_API_KEY, LIVEKIT_API_SECRET to staging endpoint, you will see things like
run tests:
cargo test -p livekit --features "__lk-e2e-test,native-tls" -- --nocapture
cargo test -p livekit --features "__lk-e2e-test,native-tls" --test peer_connection_signaling_test -- --nocapture
[INFO audio_test] Testing with 48000Hz, 1ch. -> 48000Hz, 1ch.
[INFO livekit_api::signal_client::signal_stream] connecting to wss://xianstaging-hixkk74p.staging.livekit.cloud/rtc/v1?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.30&join_request=EhsKFQgIEgYwLjcuMzAYECIFbWFjb3NgARICCAE%3D
[INFO livekit_api::signal_client::signal_stream] connecting to wss://xianstaging-hixkk74p.staging.livekit.cloud/rtc/v1?sdk=rust&protocol=16&auto_subscribe=1&adaptive_stream=0&version=0.7.30&join_request=EhsKFQgIEgYwLjcuMzAYECIFbWFjb3NgARICCAE%3D
[INFO livekit_api::signal_client] [CONNECT] SUCCESS: v1 path connection successful, single_pc_mode=true
[ERROR livekit_api::signal_client] [CONNECT] ====== CONNECTION ESTABLISHED ======