From 45519a7d853190fb40aa859c0d482ac2ecc51df4 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 19 Nov 2024 15:15:56 +0100 Subject: [PATCH] webrtc: janus: handle slowlink event Fix this warning: webrtc-janusvr-signaller imp.rs:426:gstrswebrtc::janusvr_signaller::imp::Signaller::handle_msg: Unknown message from server: { "janus": "slowlink", "session_id": 980554280060589, "sender": 5867141593320621, "mid": "video0", "media": "video", "uplink": false, "lost": 15 } Part-of: --- net/webrtc/src/janusvr_signaller/imp.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/net/webrtc/src/janusvr_signaller/imp.rs b/net/webrtc/src/janusvr_signaller/imp.rs index 36fe8d4d..39ffc5ab 100644 --- a/net/webrtc/src/janusvr_signaller/imp.rs +++ b/net/webrtc/src/janusvr_signaller/imp.rs @@ -185,6 +185,17 @@ struct InnerHangup { reason: String, } +#[derive(Serialize, Deserialize, Debug)] +struct InnerSlowLink { + session_id: u64, + sender: u64, + opaque_id: Option, + mid: String, + media: String, + uplink: bool, + lost: u64, +} + #[derive(Serialize, Deserialize, Debug)] struct RoomJoined { room: JanusId, @@ -267,6 +278,7 @@ enum JsonReply { Media, Error(InnerError), HangUp(InnerHangup), + SlowLink(InnerSlowLink), } #[derive(Default)] @@ -561,7 +573,7 @@ impl Signaller { } JsonReply::HangUp(hangup) => self.raise_error(format!("hangup: {}", hangup.reason)), // ignore for now - JsonReply::Ack | JsonReply::Media => {} + JsonReply::Ack | JsonReply::Media | JsonReply::SlowLink(_) => {} } }