pub struct Plugin<'core> { /* private fields */ }Expand description
A VapourSynth plugin.
Implementations§
Source§impl<'core> Plugin<'core>
impl<'core> Plugin<'core>
Sourcepub fn path(&self) -> Option<&'core CStr>
pub fn path(&self) -> Option<&'core CStr>
Returns the absolute path to the plugin, including the plugin’s file name. This is the real location of the plugin, i.e. there are no symbolic links in the path.
Path elements are always delimited with forward slashes.
Sourcepub fn invoke(
&self,
name: &str,
args: &Map<'core>,
) -> Result<OwnedMap<'core>, NulError>
pub fn invoke( &self, name: &str, args: &Map<'core>, ) -> Result<OwnedMap<'core>, NulError>
Invokes a filter.
invoke() makes sure the filter has no compat input nodes, checks that the args passed to
the filter are consistent with the argument list registered by the plugin that contains the
filter, creates the filter, and checks that the filter doesn’t return any compat nodes. If
everything goes smoothly, the filter will be ready to generate frames after invoke()
returns.
Returns a map containing the filter’s return value(s). Use Map::error() to check if the
filter was invoked successfully.
Most filters will either add an error to the map, or one or more clips with the key clip.
The exception to this are functions, for example LoadPlugin, which doesn’t return any
clips for obvious reasons.
Sourcepub fn register_function<F: FilterFunction>(
&self,
filter_function: F,
) -> Result<(), NulError>
pub fn register_function<F: FilterFunction>( &self, filter_function: F, ) -> Result<(), NulError>
Registers a filter function to be exported by a non-readonly plugin.
Sourcepub fn get_plugin_function_by_name(
&self,
name: &str,
) -> Result<Option<PluginFunction<'core>>, NulError>
pub fn get_plugin_function_by_name( &self, name: &str, ) -> Result<Option<PluginFunction<'core>>, NulError>
Returns a plugin function by name.
This function retrieves a specific filter function exported by the plugin. In VapourSynth v4,
this is the recommended way to query plugin functions, as the functions() method has been
removed.
Returns None if no function with the given name exists.