View Source Membrane.Matroska.Parser.EBML (Membrane Matroska plugin v0.5.1)
Helper functions for decoding and encoding EBML elements.
EBML RFC: https://datatracker.ietf.org/doc/html/rfc8794
Note that this module does not support parsing Master Elements with unknown data size https://datatracker.ietf.org/doc/html/rfc8794#name-unknown-data-size
Summary
Functions
Returns an EBML element's name, type, and data
Returns the name associated with the EBML ELEMENT_ID of the first Element in the input binary.
Returns the number encoded in the VINT_DATA field of the first VINT in the input binary
Types
@type element_type_t() ::
:integer | :uint | :float | :string | :utf_8 | :date | :master | :binary
Functions
@spec decode_element(binary()) :: {:ok, {name :: atom(), data :: binary(), rest :: binary()}} | {:error, :need_more_bytes}
Returns an EBML element's name, type, and data
Returns the name associated with the EBML ELEMENT_ID of the first Element in the input binary.
EMBL elements are identified by the hexadecimal representation of the entire leading VINT including WIDTH, MARKER and DATA
@spec decode_vint(binary()) :: {:ok, {non_neg_integer(), binary()}} | {:error, :need_more_bytes}
Returns the number encoded in the VINT_DATA field of the first VINT in the input binary
@spec parse_date(binary()) :: :calendar.datetime()
@spec parse_uint(binary()) :: non_neg_integer()