View Source ExMP4.DataWriter behaviour (MP4 Reader and Writer v0.6.0)

A behaviour module for implementing mp4 data writer.

Summary

Callbacks

Close the output.

Initialize the output.

Invoked to handle writing an ISOBMFF box.

Types

@type location() :: :file.location() | nil
@type state() :: any()

Callbacks

@callback close(state()) :: :ok

Close the output.

@callback open(input :: any()) :: {:ok, state()} | {:error, reason :: any()}

Initialize the output.

The returned state will be the first argument on the other callbacks.

Link to this callback

write(state, data, location, insert?)

View Source
@callback write(state(), data :: iodata(), location(), insert? :: boolean()) :: :ok

Invoked to handle writing an ISOBMFF box.

The data may be a binary or an IO list.

location if provided is the location in the output where to store the box. If insert? provided (defaults to false), the data should be inserted into that position and not overwriting existing data.