O
Sections
Every group

Plugins

Media linkers and hook scripts: upstream's two plugin points, registered as functions.

Symbols in this group are spelled otio_attach_… or otio_detach_… or otio_register_… or otio_unregister_…. An SDK drops that prefix, which is why the name beside each call is the short one.

attach_hook_script

free

Attaches the hook script `script` to the hook `hook`, after any attached already, declaring the hook if it is new.

The four hooks every read and write runs are `post_adapter_read`, `post_media_linker`, `pre_adapter_write` and `post_adapter_write`. Any other name declares a hook of the caller's own, which [`otio_node_run_hook`] runs. The script need not be registered yet, but must be by the time the hook runs.

OtioStatus otio_attach_hook_script(
    const char *hook,
    const char *script,
    OtioBuffer *out_error);
ParameterTypeRole
hooktextinput
scripttextinput
out_errortextwhy the call failed, or null to skip it

detach_hook_script

free

Detaches every attachment of the hook script `script` from the hook `hook`. Returns whether it was attached.

bool otio_detach_hook_script(const char *hook, const char *script);
ParameterTypeRole
hooktextinput
scripttextinput

register_hook_script

free

Registers a hook script under `name`, replacing any registered already.

It runs only at the hooks it is attached to, with [`otio_attach_hook_script`]. `context` is handed to `function` on every call, and to `release`, which may be null, once the script is replaced or unregistered. A call that fails registers nothing and releases nothing.

OtioStatus otio_register_hook_script(
    const char *name,
    OtioPluginFn function,
    void *context,
    OtioPluginReleaseFn release,
    OtioBuffer *out_error);
ParameterTypeRole
nametextinput
functionplugin<hook_script>input
context ?contextplugin context
release ?releaseplugin release
out_errortextwhy the call failed, or null to skip it

register_media_linker

free

Registers a media linker under `name`, replacing any registered already.

A read uses it when its options name it, or when the `OTIO_DEFAULT_MEDIA_LINKER` environment variable does and the options name none. `context` is handed to `function` on every call, and to `release`, which may be null, once the linker is replaced or unregistered. A call that fails registers nothing and releases nothing.

OtioStatus otio_register_media_linker(
    const char *name,
    OtioPluginFn function,
    void *context,
    OtioPluginReleaseFn release,
    OtioBuffer *out_error);
ParameterTypeRole
nametextinput
functionplugin<media_linker>input
context ?contextplugin context
release ?releaseplugin release
out_errortextwhy the call failed, or null to skip it

unregister_hook_script

free

Unregisters the hook script registered under `name`, releasing its context. Returns whether there was one.

A hook it is still attached to fails when it runs, as upstream's does for a script its manifest lists and cannot find; detach it as well.

bool otio_unregister_hook_script(const char *name);
ParameterTypeRole
nametextinput

unregister_media_linker

free

Unregisters the media linker registered under `name`, releasing its context. Returns whether there was one.

bool otio_unregister_media_linker(const char *name);
ParameterTypeRole
nametextinput