Type Alias VSPublicFunction

Source
pub type VSPublicFunction = unsafe extern "system-unwind" fn(in_: *const VSMap, out: *mut VSMap, userData: *mut c_void, core: *mut VSCore, vsapi: *const VSAPI);
Expand description

User-defined function called by the core to create an instance of the filter. This function is often named fooCreate.

In this function, the filter’s input parameters should be retrieved and validated, the filter’s private instance data should be initialised, and createAudioFilter() or createVideoFilter() should be called. This is where the filter should perform any other initialisation it requires.

If for some reason you cannot create the filter, you have to free any created node references using freeNode(), call mapSetError() on out, and return.

§Arguments

  • in - Input parameter list.

    Use mapGetInt() and friends to retrieve a parameter value.

    The map is guaranteed to exist only until the filter’s “init” function returns. In other words, pointers returned by mapGetData() will not be usable in the filter’s “getFrame” and “free” functions.

  • out - Output parameter list. createAudioFilter() or createVideoFilter() will add the output node(s) with the key named “clip”, or an error, if something went wrong.

  • userData - Pointer that was passed to registerFunction().