O
Sections
Every group

Adapter

Reading and writing the interchange formats.

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

read_from_bytes

constructor

Reads a document from the bytes of a file in some format.

`options` may be null for the format's usual behaviour. The bundle formats are refused with `OTIO_STATUS_UNSUPPORTED`: read one from its path.

OtioStatus otio_read_from_bytes(
    OtioFormat format,
    const uint8_t *data,
    size_t len,
    const OtioReadOptions *options,
    OtioDocument **out_document,
    OtioBuffer *out_error);
ParameterTypeRole
formatOtioFormatinput
databytesa buffer of bytes
lensizethe length of the buffer before it
options ?OtioReadOptionsinput
out_documentdocumentwritten through, not read
out_errortextwhy the call failed, or null to skip it

read_from_file

constructor

Reads a document from a file on disk in some format.

An AAF is read where it lies, seeking around the file, rather than copied into memory first. An `.otiod` is a directory, and `path` names it.

A build without a file system, such as one for WebAssembly, reports `OTIO_STATUS_UNSUPPORTED`; use [`otio_read_from_bytes`] there.

 *     if (otio_read_from_file(OTIO_FORMAT_CMX_3600, "cut.edl", NULL, &document,
 *                             &error)) {
 *         fprintf(stderr, "%s\n", error.data);
ParameterTypeRole
formatOtioFormatinput
pathtextinput
options ?OtioReadOptionsinput
out_documentdocumentwritten through, not read
out_errortextwhy the call failed, or null to skip it

read_options_default

free

Returns the defaults, for a caller that wants to change one field.

 * then call `otio_read_options_init()` or `otio_write_options_init()`, which
 * fill every field that size covers with its default:
 *
 *     OtioReadOptions options;
ParameterTypeRole
out_optionsOtioReadOptionswritten through, not read

write_options_default

free

Returns the defaults, for a caller that wants to change one field.

 * then call `otio_read_options_init()` or `otio_write_options_init()`, which
 * fill every field that size covers with its default:
 *
 *     OtioReadOptions options;
ParameterTypeRole
out_optionsOtioWriteOptionswritten through, not read

write_to_bytes

method

Writes a document as the bytes of a file in some format.

The buffer is NUL-terminated, so a text format's output can be used as a C string; `len` is what matters for a binary one. The bundle formats are refused with `OTIO_STATUS_UNSUPPORTED`: write one to a path.

OtioStatus otio_write_to_bytes(
    OtioFormat format,
    const OtioDocument *source,
    const OtioWriteOptions *options,
    OtioBuffer *out_bytes,
    OtioBuffer *out_error);
ParameterTypeRole
formatOtioFormatinput
source ?documentthe document, borrowed
options ?OtioWriteOptionsinput
out_bytesbyteswritten through, not read
out_errortextwhy the call failed, or null to skip it

write_to_file

method

Writes a document to a file on disk in some format.

A bundle is written from the document's root, which has to be a timeline, along with a copy of every media file it references; an `.otiod` is a directory, and `path` names it. Neither overwrites: a bundle whose `path` already exists is refused.

A build without a file system, such as one for WebAssembly, reports `OTIO_STATUS_UNSUPPORTED`; use [`otio_write_to_bytes`] there.

 *     otio_write_to_file(OTIO_FORMAT_OTIO_JSON, document, "cut.otio", NULL, NULL);
ParameterTypeRole
formatOtioFormatinput
source ?documentthe document, borrowed
pathtextinput
options ?OtioWriteOptionsinput
out_errortextwhy the call failed, or null to skip it