diff options
-rw-r--r-- | net/webrtc/examples/webrtcsink-stats-server.rs | 6 | ||||
-rw-r--r-- | net/webrtc/signalling/src/bin/server.rs | 16 | ||||
-rw-r--r-- | net/webrtc/signalling/src/server/mod.rs | 4 | ||||
-rw-r--r-- | net/webrtc/src/signaller/imp.rs | 18 | ||||
-rw-r--r-- | net/webrtc/src/webrtcsink/imp.rs | 5 | ||||
-rw-r--r-- | net/webrtc/src/webrtcsink/mod.rs | 2 |
6 files changed, 33 insertions, 18 deletions
diff --git a/net/webrtc/examples/webrtcsink-stats-server.rs b/net/webrtc/examples/webrtcsink-stats-server.rs index bf284492..e82f63d4 100644 --- a/net/webrtc/examples/webrtcsink-stats-server.rs +++ b/net/webrtc/examples/webrtcsink-stats-server.rs @@ -3,15 +3,15 @@ use std::sync::{Arc, Mutex}; use anyhow::Error; -use tokio::net::{TcpListener, TcpStream}; -use tokio::task; -use tokio::time; use async_tungstenite::tungstenite::Message as WsMessage; use clap::Parser; use futures::channel::mpsc; use futures::prelude::*; use gst::glib::Type; use gst::prelude::*; +use tokio::net::{TcpListener, TcpStream}; +use tokio::task; +use tokio::time; use tracing::{debug, info, trace}; use tracing_subscriber::prelude::*; diff --git a/net/webrtc/signalling/src/bin/server.rs b/net/webrtc/signalling/src/bin/server.rs index 35eca2ad..e024e952 100644 --- a/net/webrtc/signalling/src/bin/server.rs +++ b/net/webrtc/signalling/src/bin/server.rs @@ -1,16 +1,16 @@ // SPDX-License-Identifier: MPL-2.0 -use tokio::io::AsyncReadExt; -use tokio::task; use clap::Parser; use gst_plugin_webrtc_signalling::handlers::Handler; use gst_plugin_webrtc_signalling::server::Server; +use tokio::io::AsyncReadExt; +use tokio::task; use tracing_subscriber::prelude::*; use anyhow::Error; -use tokio_native_tls::native_tls::TlsAcceptor; use tokio::fs; use tokio::net::TcpListener; +use tokio_native_tls::native_tls::TlsAcceptor; use tracing::{info, warn}; #[derive(Parser, Debug)] @@ -67,8 +67,14 @@ async fn main() -> Result<(), Error> { let mut file = fs::File::open(cert).await?; let mut identity = vec![]; file.read_to_end(&mut identity).await?; - let identity = tokio_native_tls::native_tls::Identity::from_pkcs12(&identity, args.cert_password.as_deref().unwrap_or("")).unwrap(); - Some(tokio_native_tls::TlsAcceptor::from(TlsAcceptor::new(identity).unwrap())) + let identity = tokio_native_tls::native_tls::Identity::from_pkcs12( + &identity, + args.cert_password.as_deref().unwrap_or(""), + ) + .unwrap(); + Some(tokio_native_tls::TlsAcceptor::from( + TlsAcceptor::new(identity).unwrap(), + )) } None => None, }; diff --git a/net/webrtc/signalling/src/server/mod.rs b/net/webrtc/signalling/src/server/mod.rs index b1d4e6ff..85fbf5e4 100644 --- a/net/webrtc/signalling/src/server/mod.rs +++ b/net/webrtc/signalling/src/server/mod.rs @@ -1,15 +1,15 @@ // SPDX-License-Identifier: MPL-2.0 use anyhow::Error; -use tokio::task; use async_tungstenite::tungstenite::Message as WsMessage; use futures::channel::mpsc; use futures::prelude::*; -use tokio::io::{AsyncRead, AsyncWrite}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::pin::Pin; use std::sync::{Arc, Mutex}; +use tokio::io::{AsyncRead, AsyncWrite}; +use tokio::task; use tracing::{info, instrument, trace, warn}; struct Peer { diff --git a/net/webrtc/src/signaller/imp.rs b/net/webrtc/src/signaller/imp.rs index b4455200..611ddd39 100644 --- a/net/webrtc/src/signaller/imp.rs +++ b/net/webrtc/src/signaller/imp.rs @@ -1,8 +1,7 @@ // SPDX-License-Identifier: MPL-2.0 -use crate::webrtcsink::{RUNTIME, WebRTCSink}; +use crate::webrtcsink::{WebRTCSink, RUNTIME}; use anyhow::{anyhow, Error}; -use tokio::task; use async_tungstenite::tungstenite::Message as WsMessage; use futures::channel::mpsc; use futures::prelude::*; @@ -15,6 +14,7 @@ use once_cell::sync::Lazy; use std::collections::HashMap; use std::path::PathBuf; use std::sync::Mutex; +use tokio::task; static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { gst::DebugCategory::new( @@ -330,7 +330,12 @@ impl Signaller { if let Some(handle) = send_task_handle { if let Err(err) = handle.await { if let Some(element) = element.upgrade() { - gst::warning!(CAT, obj: element, "Error while joining send task: {}", err); + gst::warning!( + CAT, + obj: element, + "Error while joining send task: {}", + err + ); } } } @@ -338,7 +343,12 @@ impl Signaller { if let Some(handle) = receive_task_handle { if let Err(err) = handle.await { if let Some(element) = element.upgrade() { - gst::warning!(CAT, obj: element, "Error while joining receive task: {}", err); + gst::warning!( + CAT, + obj: element, + "Error while joining receive task: {}", + err + ); } } } diff --git a/net/webrtc/src/webrtcsink/imp.rs b/net/webrtc/src/webrtcsink/imp.rs index 071d68a2..fe376938 100644 --- a/net/webrtc/src/webrtcsink/imp.rs +++ b/net/webrtc/src/webrtcsink/imp.rs @@ -19,8 +19,8 @@ use std::sync::Mutex; use super::homegrown_cc::CongestionController; use super::{WebRTCSinkCongestionControl, WebRTCSinkError, WebRTCSinkMitigationMode}; -use crate::webrtcsink::RUNTIME; use crate::signaller::Signaller; +use crate::webrtcsink::RUNTIME; use std::collections::BTreeMap; static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| { @@ -1932,8 +1932,7 @@ impl WebRTCSink { let element_clone = element.downgrade(); let webrtcbin = session.webrtcbin.downgrade(); RUNTIME.spawn(async move { - let mut interval = - tokio::time::interval(std::time::Duration::from_millis(100)); + let mut interval = tokio::time::interval(std::time::Duration::from_millis(100)); loop { interval.tick().await; diff --git a/net/webrtc/src/webrtcsink/mod.rs b/net/webrtc/src/webrtcsink/mod.rs index 1446112f..d230db3d 100644 --- a/net/webrtc/src/webrtcsink/mod.rs +++ b/net/webrtc/src/webrtcsink/mod.rs @@ -9,9 +9,9 @@ use gst::glib; use gst::prelude::*; use gst::subclass::prelude::*; +use once_cell::sync::Lazy; use std::error::Error; use tokio::runtime; -use once_cell::sync::Lazy; mod homegrown_cc; mod imp; |