View Source Membrane.RTP.H265.FU.Header (Membrane RTP H265 Plugin v0.5.2)

Defines a structure representing Fragmentation Unit (FU) header which is defined in RFC7798

  +---------------+
  |0|1|2|3|4|5|6|7|
  +-+-+-+-+-+-+-+-+
  |S|E| FuType    |
  +---------------+

Summary

Types

MUST be set to true only in the last packet in a sequence.

MUST be set to true only in the first packet in a sequence.

t()

Functions

Parses Fragmentation Unit Header

Types

end_flag()

@type end_flag() :: boolean()

MUST be set to true only in the last packet in a sequence.

start_flag()

@type start_flag() :: boolean()

MUST be set to true only in the first packet in a sequence.

t()

@type t() :: %Membrane.RTP.H265.FU.Header{
  end_bit: end_flag(),
  start_bit: start_flag(),
  type: Membrane.RTP.H265.NAL.Header.type()
}

Functions

add_header(payload, start_bit, end_bit, type)

@spec add_header(binary(), 0 | 1, 0 | 1, Membrane.RTP.H265.NAL.Header.type()) ::
  binary()

Adds FU header

parse(arg1)

@spec parse(data :: binary()) ::
  {:error, :packet_malformed} | {:ok, {t(), nal :: binary()}}

Parses Fragmentation Unit Header

It will fail if the Start bit and End bit are both set to one in the same Fragmentation Unit Header, because a fragmented NAL unit MUST NOT be transmitted in one FU.