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

@ -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();