#[repr(C)]pub struct PluginV1 {
pub abi: u32,
pub size: u32,
pub describe: unsafe extern "C" fn(len: *mut usize) -> *const u8,
pub create: unsafe extern "C" fn(host: *const HostV1) -> *mut c_void,
pub destroy: unsafe extern "C" fn(instance: *mut c_void),
pub begin: unsafe extern "C" fn(instance: *mut c_void, context: *const u8, len: usize) -> i32,
pub pass: unsafe extern "C" fn(instance: *mut c_void, pass: u32, direction: u32) -> i32,
pub video: unsafe extern "C" fn(instance: *mut c_void, time: i64, width: u32, height: u32, format: u32, data: *const u8, len: usize) -> i32,
pub audio: unsafe extern "C" fn(instance: *mut c_void, start: i64, start_sample: i64, frames: u32, rate: u32, channels: u32, samples: *const f32, count: usize) -> i32,
pub end: unsafe extern "C" fn(instance: *mut c_void) -> i32,
}Expand description
The static table a native plugin’s NATIVE_ENTRY returns, which outlives every instance.
Calls other than describe and create take the instance create returned. Pointers passed to
the plugin are borrowed for the call alone. Every entry is required. /1 grows only by fields
appended here; a host reads abi and size first and refuses a table shorter than its own.
Fields§
§abi: u32§size: u32Bytes of the table as the plugin that filled it knows it.
describe: unsafe extern "C" fn(len: *mut usize) -> *const u8The descriptor as UTF-8 JSON and its length; static, valid while the library is loaded.
create: unsafe extern "C" fn(host: *const HostV1) -> *mut c_voidA new instance that calls host’s functions; null when it cannot be made. host stays
valid until destroy.
destroy: unsafe extern "C" fn(instance: *mut c_void)Frees an instance; no call takes it afterwards.
begin: unsafe extern "C" fn(instance: *mut c_void, context: *const u8, len: usize) -> i32Starts the run with its context, UTF-8 JSON.
pass: unsafe extern "C" fn(instance: *mut c_void, pass: u32, direction: u32) -> i32Starts pass pass in a direction.
video: unsafe extern "C" fn(instance: *mut c_void, time: i64, width: u32, height: u32, format: u32, data: *const u8, len: usize) -> i32One frame: len bytes of rows top first, tightly packed in a video_format.
audio: unsafe extern "C" fn(instance: *mut c_void, start: i64, start_sample: i64, frames: u32, rate: u32, channels: u32, samples: *const f32, count: usize) -> i32One block of count samples, planar, channel after channel.
end: unsafe extern "C" fn(instance: *mut c_void) -> i32Ends the run; whole-range work emits here.