feat: forward libwebrtc logs (#75)

This commit is contained in:
Théo Monnom
2023-05-24 18:37:35 +02:00
committed by GitHub
parent d5b4a8f6fc
commit 3f61e07e09
19 changed files with 300 additions and 98 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ livekit-protocol = { path = "../livekit-protocol", version = "0.1.0" }
prost = "0.11"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
tokio-tungstenite = { version = "0.18", features = ["native-tls"] }
tokio-tungstenite = { version = "0.19", features = ["native-tls"] }
tokio = { version = "1", features = ["full"] }
tokio-stream = "0.1"
parking_lot = { version = "0.12.1", features = ["send_guard"] }
+1 -1
View File
@@ -137,7 +137,7 @@ impl LocalAudioTrack {
source: NativeAudioSource,
) -> LocalAudioTrack {
let rtc_track = LkRuntime::instance()
.pc_factory
.pc_factory()
.create_audio_track(&rtc::native::create_random_uuid(), source);
Self::new(name.to_string(), rtc_track, options)
+1 -1
View File
@@ -136,7 +136,7 @@ impl LocalVideoTrack {
source: NativeVideoSource,
) -> LocalVideoTrack {
let rtc_track = LkRuntime::instance()
.pc_factory
.pc_factory()
.create_video_track(&rtc::native::create_random_uuid(), source);
Self::new(name.to_string(), rtc_track, options)
+7 -9
View File
@@ -10,7 +10,7 @@ lazy_static! {
}
pub struct LkRuntime {
pub pc_factory: PeerConnectionFactory,
pc_factory: PeerConnectionFactory,
}
impl Debug for LkRuntime {
@@ -25,19 +25,17 @@ impl LkRuntime {
if let Some(lk_runtime) = lk_runtime_ref.upgrade() {
lk_runtime
} else {
let new_runtime = Arc::new(LkRuntime::default());
trace!("LkRuntime::new()");
let new_runtime = Arc::new(Self {
pc_factory: PeerConnectionFactory::default(),
});
*lk_runtime_ref = Arc::downgrade(&new_runtime);
new_runtime
}
}
}
impl Default for LkRuntime {
fn default() -> Self {
trace!("LkRuntime::default()");
Self {
pc_factory: PeerConnectionFactory::default(),
}
pub fn pc_factory(&self) -> &PeerConnectionFactory {
&self.pc_factory
}
}
+3 -3
View File
@@ -176,14 +176,14 @@ impl RtcSession {
let mut publisher_pc = PeerTransport::new(
lk_runtime
.pc_factory
.pc_factory()
.create_peer_connection(rtc_config.clone())?,
proto::SignalTarget::Publisher,
);
let mut subscriber_pc = PeerTransport::new(
lk_runtime
.pc_factory
.pc_factory()
.create_peer_connection(rtc_config.clone())?,
proto::SignalTarget::Subscriber,
);
@@ -666,7 +666,7 @@ impl SessionInner {
if track.kind() == TrackKind::Video {
let capabilities = LkRuntime::instance()
.pc_factory
.pc_factory()
.get_rtp_sender_capabilities(track.kind().into());
let mut matched = Vec::new();