use audio_thread_priority::promote_current_thread_to_real_time; use audioipc::ipccore; use audioipc::sys; use audioipc::PlatformHandleType; use once_cell::sync::Lazy; use std::ffi::{CStr, CString}; use std::os::raw::c_void; use std::ptr; use std::sync::Mutex; use std::thread;
#[repr(C)] #[derive(Clone, Copy, Debug)] pubstruct AudioIpcServerInitParams { // Fields only need to be public for ipctest. pub thread_create_callback: Option<extern"C" fn(*const ::std::os::raw::c_char)>, pub thread_destroy_callback: Option<extern"C" fn()>,
}
// A `shm_area_size` of 0 allows the server to calculate an appropriate shm size for each stream. // A non-zero `shm_area_size` forces all allocations to the specified size. #[no_mangle] pubextern"C" fn audioipc2_server_new_client(
p: *mut c_void,
remote_pid: u32,
shm_area_size: usize,
) -> PlatformHandleType { let wrapper: &ServerWrapper = unsafe { &*(p as *mut _) };
// We create a connected pair of anonymous IPC endpoints. One side // is registered with the event loop core, the other side is returned // to the caller to be remoted to the client to complete setup. let (server_pipe, client_pipe) = match sys::make_pipe_pair() {
Ok((server_pipe, client_pipe)) => (server_pipe, client_pipe),
Err(e) => {
error!("audioipc_server_new_client - make_pipe_pair failed: {e:?}"); return audioipc::INVALID_HANDLE_VALUE;
}
};
let rpc_thread = wrapper.rpc_thread.handle(); let callback_thread = wrapper.callback_thread.handle(); let device_collection_thread = wrapper.device_collection_thread.handle();
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.