From 413d072bae8d41976125d35c5f3e825f41b4c699 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 18 Jun 2026 22:34:10 +0100 Subject: [PATCH] Test Muninn RUDP media transport profile --- crates/muninn-daemon/src/main.rs | 58 +++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/crates/muninn-daemon/src/main.rs b/crates/muninn-daemon/src/main.rs index 6e5040b..0585b1d 100644 --- a/crates/muninn-daemon/src/main.rs +++ b/crates/muninn-daemon/src/main.rs @@ -1540,19 +1540,11 @@ fn open_media_rudp_transport(options: &Options) -> Result Result CultNetRudpSocketTransportOptions { + let mut options = CultNetRudpSocketTransportOptions::client( + "muninn-media", + socket, + endpoint, + MUNINN_MEDIA_RUDP_CONNECTION_ID, + ); + options.resend_delay_ms = 5; + options.max_fragment_bytes = Some(media_profile.max_fragment_bytes as u32); + options.media_reliable_expire_after_ms = + Some(media_profile.sender_reliable_expire_after_ms); + options +} + fn video_rudp_payload_reader( tx: mpsc::Sender>, mut reader: R, @@ -6132,6 +6142,28 @@ mod tests { ); } + #[test] + fn rudp_media_transport_options_follow_low_latency_profile() { + let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); + let endpoint: SocketAddr = "127.0.0.1:5204".parse().unwrap(); + let profile = muninn_rudp_media_profile(); + + let options = muninn_media_rudp_options(socket, endpoint, &profile); + + assert_eq!(options.runtime_id, "muninn-media"); + assert_eq!(options.remote_addr, Some(endpoint)); + assert_eq!(options.connection_id, MUNINN_MEDIA_RUDP_CONNECTION_ID); + assert_eq!(options.resend_delay_ms, 5); + assert_eq!( + options.max_fragment_bytes, + Some(MUNINN_RUDP_MEDIA_MAX_FRAGMENT_BYTES as u32) + ); + assert_eq!( + options.media_reliable_expire_after_ms, + Some(MUNINN_RUDP_MEDIA_RELIABLE_EXPIRE_AFTER_MS) + ); + } + #[test] fn rudp_audio_encoder_outputs_adts_for_packetizer() { let options = Options::parse(