View Source Membrane.H264.Parser.AUSplitter (Membrane H264 plugin v0.1.0)
Module providing functionalities to divide the binary h264 stream into access units.
The access unit splitter's behaviour is based on "7.4.1.2.3 Order of NAL units and coded pictures and association to access units" of the "ITU-T Rec. H.264 (01/2012)" specification. The most crucial part of the access unit splitter is the mechanism to detect new primary coded video picture.
WARNING: Our implementation of that mechanism is based on: "7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded picture" of the "ITU-T Rec. H.264 (01/2012)", however it adds one more additional condition which, when satisfied, says that the given VCL NALu is a new primary coded picture. That condition is whether the picture is a keyframe or not.
Link to this section Summary
Types
A type representing an access unit - a list of logically associated NAL units.
A structure holding a state of the access unit splitter.
Functions
Returns a list of NAL units which are hold in access unit splitter's state accumulator and sets that accumulator empty.
Returns a structure holding a clear state of the access unit splitter.
Splits the given list of NAL units into the access units.
Link to this section Types
@type access_unit_t() :: [Membrane.H264.Parser.NALu.t()]
A type representing an access unit - a list of logically associated NAL units.
@opaque t()
A structure holding a state of the access unit splitter.
Link to this section Functions
@spec flush(t()) :: {[Membrane.H264.Parser.NALu.t()], t()}
Returns a list of NAL units which are hold in access unit splitter's state accumulator and sets that accumulator empty.
These NAL units aren't proved to form a new access units and that is why they haven't yet been
output by Membrane.H264.Parser.AUSplitter.split/2
.
@spec new() :: t()
Returns a structure holding a clear state of the access unit splitter.
@spec split([Membrane.H264.Parser.NALu.t()], t()) :: {[access_unit_t()], t()}
Splits the given list of NAL units into the access units.
It can be used for a stream which is not completly available at the time of function invoction,
as the function updates the state of the access unit splitter - the function can
be invoked once more, with new NAL units and the updated state.
Under the hood, split/2
defines a finite state machine
with two states: :first
and :second
. The state :first
describes the state before
reaching the primary coded picture NALu of a given access unit. The state :second
describes the state after processing the primary coded picture NALu of a given
access unit.