feat: forward libwebrtc logs (#75)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user