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

Defines a structure representing Network Abstraction Layer Unit Header

Defined in RFC 7798

  +---------------+---------------+
  |0|1|2|3|4|5|6|7|0|1|2|3|4|5|6|7|
  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  |F|   Type    |  LayerId  | TID |
  +-------------+-----------------+

Summary

Types

Required to be 0 in first version of HEVC, may be used in future extensions.

Specifies the temporal sub-layer identifier of the NAL unit plus 1.

t()

Specifies the type of RBSP data structure contained in the NAL unit.

Functions

Parses type stored in NAL Header

Encodes given NAL type

Types

nuh_layer_id()

@type nuh_layer_id() :: 0

Required to be 0 in first version of HEVC, may be used in future extensions.

nuh_temporal_id_plus1()

@type nuh_temporal_id_plus1() :: 1..7

Specifies the temporal sub-layer identifier of the NAL unit plus 1.

supported_types()

@type supported_types() :: :ap | :fu | :single_nalu

t()

@type t() :: %Membrane.RTP.H265.NAL.Header{
  nuh_layer_id: nuh_layer_id(),
  nuh_temporal_id_plus1: nuh_temporal_id_plus1(),
  type: type()
}

type()

@type type() :: 0..63

Specifies the type of RBSP data structure contained in the NAL unit.

types()

@type types() :: supported_types() | unsupported_types() | :reserved

unsupported_types()

@type unsupported_types() :: :paci

Functions

add_header(payload, reserved, type, layer_id, t_id)

@spec add_header(binary(), 0 | 1, type(), nuh_layer_id(), nuh_temporal_id_plus1()) ::
  binary()

Adds NAL header to payload

decode_type(header)

@spec decode_type(t()) :: types()

Parses type stored in NAL Header

encode_type(atom)

@spec encode_type(types()) :: type()

Encodes given NAL type

parse_unit_header(raw_nal)

@spec parse_unit_header(binary()) ::
  {:error, :malformed_data} | {:ok, {t(), binary()}}