WIP: Start on live_kit crate that uses a C-based bridge

This commit is contained in:
Nathan Sobo 2022-09-02 12:56:38 -06:00 committed by Antonio Scandurra
parent 52f32b50b2
commit 4bcc008cbf
12 changed files with 254 additions and 88 deletions

View 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) }
}
}