Membrane Element: FlacParser v0.3.0 Membrane.Element.FLACParser.Parser View Source
Stateful parser based on FLAC format specification available here
The parser outputs:
Membrane.Caps.Audio.FLAC
Membrane.Buffer
with "fLaC" - the FLAC stream marker in ASCII- At least one
Membrane.Buffer
with metadata block(s) Membrane.Buffer
s containing one frame each, with decoded metadata from its header (asMembrane.Caps.Audio.FLAC.FrameMetadata
struct)
The parsing is done by calling init/0
and than parse/2
with the data to parse.
The last buffer can be obtained by calling flush/1
The parser returns a frame once it encounters a beginning of the next one since there's no other way to determine where the frame ends.
Link to this section Summary
Functions
Outputs the last buffer queued in parser. Should be called afer providing all data to the parser.
Returns an initialized parser state
Parses FLAC stream, splitting it into Membrane.Buffer
s and providing caps.
Link to this section Types
Opaque struct containing state of the parser.
Link to this section Functions
Outputs the last buffer queued in parser. Should be called afer providing all data to the parser.
Returns an initialized parser state
parse(binary_data, state \\ init())
View Sourceparse(binary(), state()) :: {:ok, [Membrane.Caps.t() | Membrane.Buffer.t()], state()}
Parses FLAC stream, splitting it into Membrane.Buffer
s and providing caps.
See moduledoc (Membrane.Element.FLACParser.Parser
) for more info
The call without state
provided is an equivalent of using init/0
as state