Membrane.MP4.Track.SampleTable (Membrane MP4 plugin v0.9.0) View Source

A module that defines a structure and functions allowing to store samples, assemble them into chunks and flush when needed. Its public functions take care of recording information required to build a sample table.

For performance reasons, the module uses prepends when storing information about new samples. To compensate for it, use &Membrane.MP4.Track.SampleTable.reverse/1 when it's known that no more samples will be stored.

Link to this section Summary

Link to this section Types

Specs

t() :: %Membrane.MP4.Track.SampleTable{
  chunk: [binary()],
  chunk_first_timestamp: non_neg_integer() | nil,
  chunk_offsets: [non_neg_integer()],
  decoding_deltas: [%{sample_delta: Ratio.t(), sample_count: pos_integer()}],
  last_timestamp: non_neg_integer() | nil,
  sample_count: non_neg_integer(),
  sample_sizes: [pos_integer()],
  samples_per_chunk: [
    %{first_chunk: pos_integer(), sample_count: pos_integer()}
  ],
  sync_samples: [pos_integer()]
}

Link to this section Functions

Link to this function

chunk_duration(sample_table)

View Source

Specs

chunk_duration(t()) :: non_neg_integer()
Link to this function

flush_chunk(sample_table, chunk_offset)

View Source

Specs

flush_chunk(t(), non_neg_integer()) :: {binary(), t()}

Specs

reverse(t()) :: t()
Link to this function

store_sample(sample_table, buffer)

View Source

Specs

store_sample(t(), Membrane.Buffer.t()) :: t()