ExMP4.DataWriter behaviour (MP4 Reader and Writer v0.11.0)

View Source

A behaviour module for implementing mp4 data writer.

Summary

Callbacks

Close the output.

Initialize the output.

Invoked to handle writing an ISOBMFF box.

Types

location()

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

state()

@type state() :: any()

Callbacks

close(state)

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

Close the output.

open(input)

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

Initialize the output.

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

write(state, data, location, insert?)

@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.