From 867c2b78b6224e99e6bbfb8922f77dafa9a10303 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 19 Nov 2024 15:15:56 +0100 Subject: [PATCH] webrtc: janus: handle slow_link videoroom event Fix this warning: webrtc-janusvr-signaller imp.rs:426:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg: Unknown message from server: { "janus": "event", "session_id": 980554280060589, "sender": 5867141593320621, "plugindata": { "plugin": "janus.plugin.videoroom", "data": { "videoroom": "slow_link", "current-bitrate": 0 } } } Part-of: --- net/webrtc/src/janusvr_signaller/imp.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/webrtc/src/janusvr_signaller/imp.rs b/net/webrtc/src/janusvr_signaller/imp.rs index 8fa159cd..36fe8d4d 100644 --- a/net/webrtc/src/janusvr_signaller/imp.rs +++ b/net/webrtc/src/janusvr_signaller/imp.rs @@ -211,6 +211,12 @@ struct RoomTalking { audio_level: f32, } +#[derive(Serialize, Deserialize, Debug)] +struct SlowLink { + #[serde(rename = "current-bitrate")] + current_bitrate: u32, +} + #[derive(Serialize, Deserialize, Debug)] #[serde(tag = "videoroom", rename_all = "kebab-case")] enum VideoRoomData { @@ -219,6 +225,8 @@ enum VideoRoomData { Destroyed(RoomDestroyed), Talking(RoomTalking), StoppedTalking(RoomTalking), + #[serde(rename = "slow_link")] + SlowLink(SlowLink), } #[derive(Serialize, Deserialize, Debug)] @@ -542,6 +550,9 @@ impl Signaller { VideoRoomData::StoppedTalking(talking) => { self.emit_talking(false, talking.id, talking.audio_level); } + VideoRoomData::SlowLink(_slow_link) => { + // TODO: use to reduce the bitrate? + } } } }