Membrane.H26x.NALuParser behaviour (Membrane H.264 and H.265 plugin v0.10.4)

View Source

A module providing functionality of parsing a stream of binaries, out of which each is a payload of a single NAL unit.

Summary

Types

t()

A structure holding the state of the NALu parser.

Functions

Returns payload of the NALu with appropriate prefix generated based on output stream structure and prefix length.

Returns a structure holding a clear NALu parser state. input_stream_structure determines the prefixes of input NALU payloads.

Types

nalu_type()

@type nalu_type() :: atom()

t()

@type t() :: %Membrane.H26x.NALuParser{
  input_stream_structure: Membrane.H264.Parser.stream_structure(),
  scheme_parser_state: Membrane.H26x.NALuParser.SchemeParser.t()
}

A structure holding the state of the NALu parser.

Callbacks

get_nalu_header_and_body(binary)

@callback get_nalu_header_and_body(binary()) :: {binary(), binary()}

get_nalu_type(non_neg_integer)

@callback get_nalu_type(non_neg_integer()) :: nalu_type()

parse_nalu_header(binary, t)

parse_proper_nalu_type(binary, nalu_type, t)

Functions

get_prefixed_nalu_payload(nalu, output_stream_structure, stable_prefixing? \\ true)

@spec get_prefixed_nalu_payload(
  Membrane.H26x.NALu.t(),
  Membrane.H264.Parser.stream_structure(),
  boolean()
) :: binary()

Returns payload of the NALu with appropriate prefix generated based on output stream structure and prefix length.

new(input_stream_structure)

Returns a structure holding a clear NALu parser state. input_stream_structure determines the prefixes of input NALU payloads.

prefix_nalus_payloads(nalus, arg2)

@spec prefix_nalus_payloads([binary()], Membrane.H264.Parser.stream_structure()) ::
  binary()

unprefix_nalu_payload(nalu_payload, arg2)

@spec unprefix_nalu_payload(binary(), Membrane.H264.Parser.stream_structure()) ::
  {stripped_prefix :: binary(), payload :: binary()}