use std::os::raw::{c_char, c_int, c_void};
include!(concat!(env!("OUT_DIR"), "/fbs.rs"));
#[repr(transparent)]
#[derive(Copy, Clone)]
pub struct UvAsyncT(pub *const c_void);
unsafe impl Send for UvAsyncT {}
#[repr(transparent)]
pub struct ChannelReadCtx(pub *const c_void);
pub type ChannelReadFreeFn = Option<
unsafe extern "C" fn(
*mut u8,
u32,
usize,
),
>;
pub type ChannelReadFn = unsafe extern "C" fn(
*mut *mut u8,
*mut u32,
*mut usize,
UvAsyncT,
ChannelReadCtx,
) -> ChannelReadFreeFn;
unsafe impl Send for ChannelReadCtx {}
#[repr(transparent)]
pub struct ChannelWriteCtx(pub *const c_void);
pub type ChannelWriteFn = unsafe extern "C" fn(
*const u8,
u32,
ChannelWriteCtx,
);
unsafe impl Send for ChannelWriteCtx {}
#[link(name = "mediasoup-worker", kind = "static")]
extern "C" {
pub fn uv_async_send(handle: UvAsyncT) -> c_int;
pub fn mediasoup_worker_run(
argc: c_int,
argv: *const *const c_char,
version: *const c_char,
consumer_channel_fd: c_int,
producer_channel_fd: c_int,
channel_read_fn: ChannelReadFn,
channel_read_ctx: ChannelReadCtx,
channel_write_fn: ChannelWriteFn,
channel_write_ctx: ChannelWriteCtx,
) -> c_int;
}