View Source Membrane.H26x.NALu (Membrane H.264 and H.265 plugin v0.10.0)

A module defining a struct representing a single NAL unit.

Summary

Types

t()

A type defining the structure of a single NAL unit produced by the Membrane.H26x.NALuParser.

Types

@type t() :: %Membrane.H26x.NALu{
  parsed_fields: %{required(atom()) => any()},
  payload: binary(),
  status: :valid | :error,
  stripped_prefix: binary(),
  timestamps: timestamps(),
  type:
    Membrane.H264.NALuTypes.nalu_type() | Membrane.H265.NALuTypes.nalu_type()
}

A type defining the structure of a single NAL unit produced by the Membrane.H26x.NALuParser.

In the structure there ardqde following fields:

  • parsed_fields - the map with keys being the NALu field names and the values being the value fetched from the NALu binary. They correspond to the NALu schemes defined in the H26x specification documents.
  • stripped_prefix - prefix that used to split the NAL units in the bytestream and was stripped from the payload. The prefix is defined as in: "Annex B" of the "ISO/IEC 14496-10" or in "ISO/IEC 14496-15".
  • type - an atom representing the type of the NALu. Atom's name is based on the "Table 7-1 – NAL unit type codes, syntax element categories, and NAL unit type classes" of the "ITU-T Rec. H.264 (01/2012)".
  • payload - the binary, which parsing resulted in that structure being produced stripped of it's prefix
  • status - :valid, if the parsing was successfull, :error otherwise
@type timestamps() :: {pts :: integer() | nil, dts :: integer() | nil}

Functions

@spec int_type(t()) :: non_neg_integer()