Membrane.RTP.H264.FU (Membrane RTP H264 Plugin v0.4.1) View Source

Module responsible for parsing H264 Fragmentation Unit.

Link to this section Summary

Functions

Parses H264 Fragmentation Unit

Serialize H264 unit into list of FU-A payloads

Link to this section Types

Specs

t() :: %Membrane.RTP.H264.FU{
  data: [binary()],
  last_seq_num: nil | non_neg_integer()
}

Link to this section Functions

Link to this function

parse(data, seq_num, acc)

View Source

Specs

parse(binary(), non_neg_integer(), t()) ::
  {:ok, {binary(), Membrane.RTP.H264.NAL.Header.type()}}
  | {:error, :packet_malformed | :invalid_first_packet}
  | {:incomplete, t()}

Parses H264 Fragmentation Unit

If a packet that is being parsed is not considered last then a {:incomplete, t()} tuple will be returned. In case of last packet {:ok, {type, data}} tuple will be returned, where data is NAL Unit created by concatenating subsequent Fragmentation Units.

Link to this function

serialize(data, preferred_size)

View Source

Specs

serialize(binary(), pos_integer()) :: [binary()] | {:error, :unit_too_small}

Serialize H264 unit into list of FU-A payloads