Parse::Matroska::Definitions - internal EBML grammar definitions
version 0.002
use Parse::Matroska::Definitions qw{elem_by_hexid}; my $ebml_id = elem_by_hexid('1a45dfa3'); print "EBML ID $ebml_id->{elid}'s name: $ebml_id->{name}";
Contains the definition of the EBML grammar as expected in Matroska files. This module is meant mostly for internal use.
As this was extended from a script in mpv-player, some data generated is apparently useless for regular module users but is still relevant to the mpv-player script. Such data is annotated as being for mpv compatibility.
Returns an EBML Element Definition corresponding to the provided hexadecimal string. Returns undef if the element is unknown.
undef
NOTE: never call this function yourself; it changes data structures that are considered immutable outside of this package.
Internal API function that generates the EBML Element Definitions.
This API function returns an array which first element is $elid and the second is a generated hash. The generated hash is stored in the @global_elem_list and %global_elem_dict.
$elid
The generated hash contains:
The EBML Element's name, given through $name.
$name
The EBML Element's hex id, given through $elid. Used for lookups by "elem_by_hexid($id)".
The EBML Element's type, given through $valtype, except when $valtype is an arrayref.
$valtype
If $name ends with a *, this is set as true and strips the * from "name". Used to mark elements that may be repeated.
*
An arrayref of elements that may be children of this element, given through $valtype if it is an arrayref. Sets "valtype" to sub if there are subelements.
sub
An arrayref listing all the "elid"s of subelements, uniqified.
uniq
The following elements are for mpv compatibility:
Name used for generating C #defines.
Name used for generating C struct fields.
Name used for generating C struct names.
A pre-#defined constant to describe the element's type.
Typename used when declaring a struct field referring to this element.
Internal function that defines the EBML generic grammar.
Must not be called from outside the package.
Internal function that defines the Matroska-specific EBML grammar.
The API of this module is not yet considered stable.
These global variables are considered immutable.
A global list of known matroska elements. Useful for mpv's matroska script, used for generating C headers that parse matroska.
A global hash of known matroska elements. Used internally by "elem_by_hexid($id)".
Optionally-importable hash of known EBML IDs belonging to the EBML generic grammar.
Optionally-importable hash of known EBML IDs belonging to the Matroska-specific grammar.
Kovensky <diogomfranco@gmail.com>
This software is Copyright (c) 2012 by Diogo Franco.
This is free software, licensed under:
The (two-clause) FreeBSD License
To install Parse::Matroska, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Parse::Matroska
CPAN shell
perl -MCPAN -e shell install Parse::Matroska
For more information on module installation, please visit the detailed CPAN module installation guide.