View Source Membrane.Matroska.Parser.EBML (Membrane Matroska plugin v0.1.1)
Helper functions for decoding and encoding EBML elements.
EBML RFC: https://www.rfc-editor.org/rfc/rfc8794.html
Note that this module does not support parsing Master Elements with unknown data size https://www.rfc-editor.org/rfc/rfc8794.html#section-6.2
Link to this section 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
Link to this section Types
@type element_type_t() ::
:integer | :uint | :float | :string | :utf_8 | :date | :master | :binary
Link to this section 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()