Loading common/src/publisher.rs +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ pub enum PublisherMessage { CreateRoom { name: String, description: Option<String>, latency: Option<u32>, }, Ice { candidate: String, Loading publisher/src/config.rs +4 −0 Original line number Diff line number Diff line Loading @@ -72,4 +72,8 @@ pub struct Config { /// Channel configuration to use, can be mono or stereo. #[structopt(long, default_value = "mono")] pub channel_configuration: ChannelConfiguration, /// Server-side latency. #[structopt(long, default_value = "200")] pub server_latency: u32, } publisher/src/publisher.rs +1 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ impl Publisher { serde_json::to_string(&PublisherMessage::CreateRoom { name: cfg.server_room.clone(), description: cfg.server_room_description.clone(), latency: Some(cfg.server_latency), }) .expect("Failed to serialize create room message"), )) Loading server/src/publisher.rs +11 −3 Original line number Diff line number Diff line Loading @@ -275,12 +275,20 @@ impl Publisher { /// Handle JSON messages from the publisher. fn handle_message(&mut self, ctx: &mut ws::WebsocketContext<Self>, text: &str) { match serde_json::from_str::<PublisherMessage>(text) { Ok(PublisherMessage::CreateRoom { name, description }) => { Ok(PublisherMessage::CreateRoom { name, description, latency, }) => { debug!( "Publisher {} asked to create new room {} with description {:?}", self.remote_addr, name, description "Publisher {} asked to create new room {} with description {:?} and latency {:?}", self.remote_addr, name, description, latency, ); self.webrtcbin .set_property("latency", &latency.unwrap_or(200)) .expect("Failed to set latency property"); // Check if we can join a room currently. { match &self.room_state { Loading Loading
common/src/publisher.rs +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ pub enum PublisherMessage { CreateRoom { name: String, description: Option<String>, latency: Option<u32>, }, Ice { candidate: String, Loading
publisher/src/config.rs +4 −0 Original line number Diff line number Diff line Loading @@ -72,4 +72,8 @@ pub struct Config { /// Channel configuration to use, can be mono or stereo. #[structopt(long, default_value = "mono")] pub channel_configuration: ChannelConfiguration, /// Server-side latency. #[structopt(long, default_value = "200")] pub server_latency: u32, }
publisher/src/publisher.rs +1 −0 Original line number Diff line number Diff line Loading @@ -341,6 +341,7 @@ impl Publisher { serde_json::to_string(&PublisherMessage::CreateRoom { name: cfg.server_room.clone(), description: cfg.server_room_description.clone(), latency: Some(cfg.server_latency), }) .expect("Failed to serialize create room message"), )) Loading
server/src/publisher.rs +11 −3 Original line number Diff line number Diff line Loading @@ -275,12 +275,20 @@ impl Publisher { /// Handle JSON messages from the publisher. fn handle_message(&mut self, ctx: &mut ws::WebsocketContext<Self>, text: &str) { match serde_json::from_str::<PublisherMessage>(text) { Ok(PublisherMessage::CreateRoom { name, description }) => { Ok(PublisherMessage::CreateRoom { name, description, latency, }) => { debug!( "Publisher {} asked to create new room {} with description {:?}", self.remote_addr, name, description "Publisher {} asked to create new room {} with description {:?} and latency {:?}", self.remote_addr, name, description, latency, ); self.webrtcbin .set_property("latency", &latency.unwrap_or(200)) .expect("Failed to set latency property"); // Check if we can join a room currently. { match &self.room_state { Loading