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.
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);| Parameter | Type | Role |
|---|---|---|
| hook | text | input |
| script | text | input |
| out_error | text | why the call failed, or null to skip it |
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);| Parameter | Type | Role |
|---|---|---|
| hook | text | input |
| script | text | input |
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);| Parameter | Type | Role |
|---|---|---|
| name | text | input |
| function | plugin<hook_script> | input |
| context ? | context | plugin context |
| release ? | release | plugin release |
| out_error | text | why the call failed, or null to skip it |
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);| Parameter | Type | Role |
|---|---|---|
| name | text | input |
| function | plugin<media_linker> | input |
| context ? | context | plugin context |
| release ? | release | plugin release |
| out_error | text | why the call failed, or null to skip it |
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);| Parameter | Type | Role |
|---|---|---|
| name | text | input |
Unregisters the media linker registered under `name`, releasing its context. Returns whether there was one.
bool otio_unregister_media_linker(const char *name);| Parameter | Type | Role |
|---|---|---|
| name | text | input |