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
|
@ -22,6 +22,7 @@ use gpui::{
|
|||
platform::current::Surface,
|
||||
Menu, MenuItem, ViewContext,
|
||||
};
|
||||
use live_kit::Room;
|
||||
use log::LevelFilter;
|
||||
use media::{
|
||||
core_media::{
|
||||
|
@ -47,29 +48,6 @@ const NSUTF8StringEncoding: NSUInteger = 4;
|
|||
|
||||
actions!(capture, [Quit]);
|
||||
|
||||
extern "C" {
|
||||
fn LKRoomCreate() -> *const c_void;
|
||||
fn LKRoomDestroy(ptr: *const c_void);
|
||||
}
|
||||
|
||||
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) }
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("Creating room...");
|
||||
let room = Room::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue