View Source ExMP4.Write behaviour (MP4 Reader and Writer v0.3.0)

A behaviour defining how to write data to a destination

Summary

Callbacks

Close the input stream.

Open the provided input in write mode

Seek and write to the stream.

Write the data

Types

@type location() :: {:cur, offset :: integer()} | integer()
@type reason() :: any()
@type state() :: any()

Callbacks

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

Close the input stream.

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

Open the provided input in write mode

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

Link to this callback

pwrite(state, location, data, insert?)

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

Seek and write to the stream.

@callback write(state(), data :: iodata()) :: :ok

Write the data