publish client-sdk-native (#12)
* Create README.md * add example * crates & examples * fix syntax * add LICENSE * thirdparty LICENSE * rearrange repo * fix build * egui versions * prepare publish * fix demo compilation * add test ci * Update rust.yml * forgot runs-on * install protoc before building * avoid rate limit * include submodules * updates to readme * cache rust builds Co-authored-by: David Zhao <[email protected]> Co-authored-by: David Zhao <[email protected]>
This commit is contained in:
co-authored by
David Zhao
David Zhao
parent
a927baac94
commit
a07b3451a3
@@ -0,0 +1,37 @@
|
||||
use std::fmt::{Debug, Formatter};
|
||||
|
||||
use tracing::trace;
|
||||
|
||||
use livekit_webrtc::peer_connection_factory::PeerConnectionFactory;
|
||||
use livekit_webrtc::webrtc::RTCRuntime;
|
||||
|
||||
/// SAFETY: The order of initialization and deletion is important for LKRuntime.
|
||||
/// See the C++ constructors & destructors of these fields
|
||||
|
||||
pub struct LKRuntime {
|
||||
pub pc_factory: PeerConnectionFactory,
|
||||
pub rtc_runtime: RTCRuntime,
|
||||
}
|
||||
|
||||
impl Debug for LKRuntime {
|
||||
fn fmt(&self, f: &mut Formatter) -> std::fmt::Result {
|
||||
write!(f, "LKRuntime")
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for LKRuntime {
|
||||
fn default() -> Self {
|
||||
trace!("LKRuntime::default()");
|
||||
let rtc_runtime = RTCRuntime::new();
|
||||
Self {
|
||||
pc_factory: PeerConnectionFactory::new(rtc_runtime.clone()),
|
||||
rtc_runtime,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for LKRuntime {
|
||||
fn drop(&mut self) {
|
||||
trace!("LKRuntime::drop()");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user