Skip to main content

PluginCreateFn

Type Alias PluginCreateFn 

Source
pub type PluginCreateFn = unsafe extern "C" fn() -> *mut dyn CodecPlugin;
Expand description

Function signature for the plugin factory function.

The shared library must export this as: extern "C" fn oximedia_plugin_create() -> *mut dyn CodecPlugin

The returned pointer must have been created via Box::into_raw(Box::new(...)). The host takes ownership and will drop it when the plugin is unloaded.

Note: trait objects are not FFI-safe per Rust’s type system, but this is the standard pattern for Rust-to-Rust plugin loading where both sides share the same trait definition and ABI. This is safe as long as both the host and plugin are compiled with the same Rust compiler version.