WIP: Start on live_kit crate that uses a C-based bridge
This commit is contained in:
parent
52f32b50b2
commit
4bcc008cbf
12 changed files with 254 additions and 88 deletions
24
crates/live_kit/src/live_kit.rs
Normal file
24
crates/live_kit/src/live_kit.rs
Normal file
|
@ -0,0 +1,24 @@
|
|||
use std::ffi::c_void;
|
||||
|
||||
extern "C" {
|
||||
fn LKRoomCreate() -> *const c_void;
|
||||
fn LKRoomDestroy(ptr: *const c_void);
|
||||
}
|
||||
|
||||
pub struct Room {
|
||||
native_room: *const c_void,
|
||||
}
|
||||
|
||||
impl Room {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
native_room: unsafe { LKRoomCreate() },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Room {
|
||||
fn drop(&mut self) {
|
||||
unsafe { LKRoomDestroy(self.native_room) }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue