View Source Membrane.H264.Parser.NALuParser (Membrane H264 plugin v0.9.3)
A module providing functionality of parsing a stream of binaries, out of which each is a payload of a single NAL unit.
Summary
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.
Parses a binary representing a single NALu and removes it's prefix (if it exists).
Parses a list of binaries, each representing a single NALu.
Types
@opaque t()
A structure holding the state of the NALu parser.
Functions
get_prefixed_nalu_payload(nalu, output_stream_structure, stable_prefixing? \\ true)
View Source@spec get_prefixed_nalu_payload( Membrane.H264.Parser.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.
@spec new(Membrane.H264.Parser.stream_structure()) :: t()
Returns a structure holding a clear NALu parser state. input_stream_structure
determines the prefixes of input NALU payloads.
parse(nalu_payload, timestamps \\ {nil, nil}, payload_prefixed? \\ true, state)
View Source@spec parse(binary(), Membrane.H264.Parser.NALu.timestamps(), boolean(), t()) :: {Membrane.H264.Parser.NALu.t(), t()}
Parses a binary representing a single NALu and removes it's prefix (if it exists).
Returns a structure that
contains parsed fields fetched from that NALu.
When payload_prefixed?
is true the input binary is expected to contain one of:
- prefix defined as the "Annex B" of the "ITU-T Rec. H.264 (01/2012)".
- prefix of size defined in state describing the length of the NALU in bytes, as described in ISO/IEC 14496-15.
parse_nalus(nalus_payloads, timestamps \\ {nil, nil}, payload_prefixed? \\ true, state)
View Source@spec parse_nalus([binary()], Membrane.H264.Parser.NALu.timestamps(), boolean(), t()) :: {[Membrane.H264.Parser.NALu.t()], t()}
Parses a list of binaries, each representing a single NALu.
See parse/3
for details.
@spec prefix_nalus_payloads([binary()], Membrane.H264.Parser.stream_structure()) :: binary()