Skip to main content

PluginV1

Struct PluginV1 

Source
#[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: u32

Bytes of the table as the plugin that filled it knows it.

§describe: unsafe extern "C" fn(len: *mut usize) -> *const u8

The 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_void

A 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) -> i32

Starts the run with its context, UTF-8 JSON.

§pass: unsafe extern "C" fn(instance: *mut c_void, pass: u32, direction: u32) -> i32

Starts 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) -> i32

One 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) -> i32

One block of count samples, planar, channel after channel.

§end: unsafe extern "C" fn(instance: *mut c_void) -> i32

Ends the run; whole-range work emits here.

Trait Implementations§

Source§

impl Clone for PluginV1

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PluginV1

Source§

impl Debug for PluginV1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.