O
Sections
Every group

Sync

Timeline sync, an otio-rust extension and not part of OpenTimelineIO: sharing a timeline between programs while it is edited.

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

apply

free

Applies the JSON list of patches `patches` to the timeline JSON `timeline`, as Furnace's `otiodiff` does, and writes the patched timeline to `out_timeline` as compact JSON.

ParameterTypeRole
timelinetextinput
patchestextinput
out_timelinetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

apply_to

free

Applies the JSON list of patches `patches` to `timeline` in place.

The timeline keeps its handle, as does every synced object in it that the patches keep; one they remove is stale afterwards. On failure the document is left as it was.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
patchestextinput
out_errortextwhy the call failed, or null to skip it

begin

free

Starts a transaction on `timeline`, which is `sequence_id` at `generation`: stamps any missing GUIDs, and writes the timeline as it is to `out_before` as a snapshot.

The snapshot is the transaction. Keep it, edit the timeline, and pass it to `otio_ext_sync_commit` for the patches, or to `otio_ext_sync_rollback` to undo the edits.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
sequence_idtextinput
generationint64input
out_beforetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

commit

free

Ends the transaction `otio_ext_sync_begin` wrote as `before`, writing the patches that take the timeline as it was to the timeline as it is, the next generation, to `out_patches` as a compact JSON list.

An edit that changed nothing writes `[]`.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
beforetextinput
out_patchestextwritten through, not read
out_errortextwhy the call failed, or null to skip it

commit_journal

free

Takes what the journal of the document `timeline` is in recorded since it started or was last committed, runs the `document_changed` hook on the document's root with it if anything changed, and writes whether anything did to `out_changed`.

The hook's arguments are `touched`, the GUIDs of the synced objects that were added or may have changed, and `root_changed`.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
out_changedboolwritten through, not read
out_errortextwhy the call failed, or null to skip it

diff

free

Works out the patches that take the snapshot `old_snapshot` to the snapshot `new_snapshot`, as Furnace's `otiodiff` does, and writes them to `out_patches` as a JSON list.

A snapshot is JSON as Furnace sends one: `sequenceId`, `generation`, and the timeline as `otioJson`. With `pretty`, the list is indented as Furnace's golden files are; otherwise it is compact. A change too large for patches, or one between sequences or back in generation, is one `replace_timeline` patch; `otio_ext_sync_diff_stats` says why.

ParameterTypeRole
old_snapshottextinput
new_snapshottextinput
prettyboolinput
out_patchestextwritten through, not read
out_errortextwhy the call failed, or null to skip it

diff_stats

free

Writes what `otio_ext_sync_diff` does with the same snapshots to `out_stats`, as a JSON object: `insertOps`, `moveOps`, `removeOps`, `setPropertyOps`, `totalOps`, `nodeCount`, `fellBack` and `fallbackReason`.

ParameterTypeRole
old_snapshottextinput
new_snapshottextinput
out_statstextwritten through, not read
out_errortextwhy the call failed, or null to skip it

enable

free

Turns timeline sync on. The same as `otio_ext_enable("sync")`.

Enabling it again does nothing and succeeds.

ParameterTypeRole
out_errortextwhy the call failed, or null to skip it

find

freemay answer nothing

Finds the object under `timeline` that carries the GUID `guid`, and writes it to `out_node`.

Reports `OTIO_STATUS_NO_VALUE` when none does, and `OTIO_STATUS_INVALID_ARGUMENT` when two do; stamp first to rule that out.

ParameterTypeRole
source ?documentthe document, borrowed
timelinenodeinput
guidtextinput
out_nodenodewritten through, not read
out_errortextwhy the call failed, or null to skip it

guid

freemay answer nothing

Writes the GUID `node` carries in `metadata.sync.guid` to `out_guid`.

Reports `OTIO_STATUS_NO_VALUE` for an object that carries none.

ParameterTypeRole
source ?documentthe document, borrowed
nodenodeinput
out_guidtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

handle

free

Acts on the JSON `event` from `otio_ext_sync_session_poll_event` in `timeline`, the program's copy of the timeline the event names, and writes what it did to `out_handled` as a JSON object: `handled`, one of `applied`, `replaced`, `rejected`, `joined` or `ignored`, and for `rejected` the script's `message`.

A `timeline` event runs `sync_before_apply`, whose scripts may refuse it, applies its patches so the timeline and the objects that survive keep their handles, falling back to the whole snapshot if the patches do not fit (`replaced`), runs the default media linker on what it inserted, then `sync_after_apply`. A `joined` event runs `sync_joined`. Every other event is the program's to act on, and is `ignored`.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
eventtextinput
out_handledtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

is_enabled

free

Writes whether timeline sync is on to `out_enabled`.

ParameterTypeRole
out_enabledboolwritten through, not read
out_errortextwhy the call failed, or null to skip it

new_guid

free

Writes a new GUID, a version 4 UUID, to `out_guid`.

ParameterTypeRole
out_guidtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

rollback

free

Ends the transaction `otio_ext_sync_begin` wrote as `before`, putting the timeline back as it was.

The timeline and every synced object that was in it keep their handles.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
beforetextinput
out_errortextwhy the call failed, or null to skip it

session_cancel_review

free

Stops sending the review commit `client_mutation_id`, and writes whether it was waiting to `out_cancelled`.

ParameterTypeRole
sessionuint64input
client_mutation_idtextinput
out_cancelledboolwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_close

free

Releases `session`, whose number names nothing afterwards. Closing one already closed does nothing and succeeds. A session another call is using is released when that call returns.

It sends nothing: call `otio_ext_sync_session_leave` and send the goodbye first to leave politely.

ParameterTypeRole
sessionuint64input
out_errortextwhy the call failed, or null to skip it

session_commit_review

free

Commits a review comment, the JSON object `commit`, to the session's ledger, and writes its id to `out_id`.

`commit` holds `anchor`, `bodyMarkdown`, `annotationCommands` and `clientMutationId`, which is made up if left out. The commit is sent again after every reconnect until the server acknowledges or refuses it.

ParameterTypeRole
sessionuint64input
committextinput
out_idtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_connect

free

Starts joining on a new connection: call it once the socket is open, and again after a reconnect. The hello is the next frame to send.

ParameterTypeRole
sessionuint64input
out_errortextwhy the call failed, or null to skip it

session_disconnected

free

Tells `session` the socket closed. It waits for `otio_ext_sync_session_connect`, keeping its timelines and the review commits not yet acknowledged.

ParameterTypeRole
sessionuint64input
out_errortextwhy the call failed, or null to skip it

session_leave

free

Leaves the session: the goodbye is the next frame to send, after which the socket can close.

ParameterTypeRole
sessionuint64input
out_errortextwhy the call failed, or null to skip it

session_may_send

free

Writes whether `session` may send on `channel` now to `out_may`: it has joined, and its role holds the channel's lease.

ParameterTypeRole
sessionuint64input
channeltextinput
out_mayboolwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_new

free

Makes a session from the JSON object `settings`, and writes the number that names it to `out_session`. Release it with `otio_ext_sync_session_close`.

`settings` holds `token`, the token the server issued; `identity`, who the client is (`displayName`, `app`, `appVersion`, `credential`, `deviceId`, `clientKind`, `formFactor`, `deviceName` and `capabilities`); and `encodings`, the compression it accepts (`br`, `gzip`). Each may be left out: `{}` is a guest desktop editor accepting every encoding.

ParameterTypeRole
settingstextinput
out_sessionuint64written through, not read
out_errortextwhy the call failed, or null to skip it

session_poll_event

freemay answer nothing

Writes the next event to `out_event` as a JSON object, whose `type` is `joined`, `timeline`, `playhead`, `selection`, `roster`, `leader`, `review_relay`, `review_committed`, `review_rejected`, `error`, `ended` or `message`.

Reports `OTIO_STATUS_NO_VALUE` when there is none. Pass a `timeline` or `joined` event to `otio_ext_sync_handle` to apply it.

ParameterTypeRole
sessionuint64input
out_eventtextwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_poll_transmit

freemay answer nothing

Writes the next frame to send to `out_bytes`, stamped with `now` in Unix milliseconds, and whether to send it as a binary WebSocket frame rather than a text one to `out_binary`.

Reports `OTIO_STATUS_NO_VALUE` when there is nothing to send. Call it until then after every other session call.

ParameterTypeRole
sessionuint64input
nowint64input
out_bytesbyteswritten through, not read
out_binaryboolwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_publish

free

Sends `timeline`, as the sequence `sequence_id`, to the session, and writes the patches from the version sent before to `out_patches` as a JSON list. Only the host may.

Stamps missing GUIDs and runs `sync_before_send`, whose scripts may stop it. Sending a timeline that has not changed sends nothing and writes `[]`, unless it switches the active sequence.

ParameterTypeRole
sessionuint64input
targetdocumentthe document, changed
timelinenodeinput
sequence_idtextinput
out_patchestextwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_receive

free

Hands `session` a frame that arrived: `binary` says whether it was a binary WebSocket frame rather than a text one.

A failure means the connection broke the protocol or lost frames: close the socket, call `otio_ext_sync_session_disconnected`, and connect again.

ParameterTypeRole
sessionuint64input
databytesa buffer of bytes
lensizethe length of the buffer before it
binaryboolinput
out_errortextwhy the call failed, or null to skip it

session_register_channel

free

Registers the channel `name`, for another extension's messages, with the delivery rule `delivery`: `latest_wins`, `ordered` or `transient`.

ParameterTypeRole
sessionuint64input
nametextinput
deliverytextinput
out_errortextwhy the call failed, or null to skip it

session_send

free

Sends a message of type `kind` with the JSON `payload` on `channel`.

It is for what sync has no call of its own for: on Furnace, `signal` on the signal channel, and the host's `bin`, `lan_mode_set` and `lan_decision` on the control channel. Furnace closes a connection that sends a type it does not know, so anything else is refused with `OTIO_STATUS_UNSUPPORTED` when it is about to be sent.

ParameterTypeRole
sessionuint64input
channeltextinput
kindtextinput
payloadtextinput
out_errortextwhy the call failed, or null to skip it

session_set_leader

free

Makes `participant` the playback leader. Only the host may.

ParameterTypeRole
sessionuint64input
participanttextinput
out_errortextwhy the call failed, or null to skip it

session_set_muted

free

Mutes or unmutes `participant`. Only the host may.

ParameterTypeRole
sessionuint64input
participanttextinput
mutedboolinput
out_errortextwhy the call failed, or null to skip it

session_set_playhead

free

Moves this client's playhead in `sequence_id` to `frame`, playing at `rate` or stopped.

ParameterTypeRole
sessionuint64input
sequence_idtextinput
framedoubleinput
playingboolinput
ratedoubleinput
out_errortextwhy the call failed, or null to skip it

session_set_selection

free

Selects the objects in `sequence_id` whose GUIDs the JSON list `guids` holds.

ParameterTypeRole
sessionuint64input
sequence_idtextinput
guidstextinput
out_errortextwhy the call failed, or null to skip it

session_state

free

Writes where `session` stands to `out_state` as a JSON object: `joined`, `ended`, `sessionId`, `selfId`, `selfUserId`, `role`, `leader`, `peers`, `activeSequence`, `sequences`, `pendingReviews`, and the protocol `version` and `encodings` the server chose.

ParameterTypeRole
sessionuint64input
out_statetextwritten through, not read
out_errortextwhy the call failed, or null to skip it

session_timeline

freemay answer nothing

Writes the latest snapshot of `sequence_id` that `session` sent or received to `out_snapshot`.

Reports `OTIO_STATUS_NO_VALUE` when it has none.

ParameterTypeRole
sessionuint64input
sequence_idtextinput
out_snapshottextwritten through, not read
out_errortextwhy the call failed, or null to skip it

set_guid

free

Gives `node` the GUID `guid`, replacing any it had.

ParameterTypeRole
targetdocumentthe document, changed
nodenodeinput
guidtextinput
out_errortextwhy the call failed, or null to skip it

stamp

free

Gives every object sync addresses under `timeline` a GUID, if it lacks one or shares one with an object met earlier, and writes how many it gave one to to `out_count`.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
out_countsizewritten through, not read
out_errortextwhy the call failed, or null to skip it

start_journal

free

Starts recording which objects any edit to the document `timeline` is in touches.

The journal is the document's, so it records edits anywhere in it; the timeline only says which document. Recording again does nothing and succeeds.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
out_errortextwhy the call failed, or null to skip it

stop_journal

free

Stops recording edits to the document `timeline` is in, and forgets what was recorded since the last commit.

ParameterTypeRole
targetdocumentthe document, changed
timelinenodeinput
out_errortextwhy the call failed, or null to skip it