[Matroska-devel] State of the libebml / libmatroska API and codebase
arnavion at gmail.com
Sun Sep 16 10:52:33 CEST 2012
I'm building a program like MKVExtractGUI for Linux; personal project for
now. This is the first time I've worked with EBML and Matroska, so I had a
bunch of questions:
Apart from the technical specs on the website about how EBML and Matroska
files are laid out, and the documentation in the headers, is there no other
documentation? I've of course been looking through the relevant bits in
mkvtoolnix and mkxuncat. Is that really all of it?
The code seems to be... severely broken in places. For example,
EbmlElement::FindNextID takes in what seems to be an indicator of what kind
of element I want it to give me (say, KaxTracks), but looking at the code
in EbmlElement::FindNextID it seems it just returns the next element it
finds. The code which _should_ check if the element's ID matches the one
passed in to the function is commented out with a TODO that this is the
wrong element being returned. Is my understanding correct? If so, then what
exactly is the user of this API expected to do w.r.t. the argument he
passes in and the element he gets back?
The code in mkvtoolnix as well as mkxuncat seems to work by iterating
through each level of EBML nodes manually. Is this really what is expected
of a program which wants to, say, enumerate all the tracks in an MKV file?
I understand that the API is deliberately low-level, but are there no
abstractions for this? No GetTracks method, for example?
(Coding standards nitpick) libmatroska's headers have "using namespace
libebml;" in them, which means any file which includes a libmatroska header
can use libebml classes without prefixing the namespace. Headers should not
have "using namespace" declarations.
None of the functions have remotely correct documentation. Some of them
have docs for parameters which don't exist! EbmlElement::FindNextElement
mentions a parameter called LowLevel, which I guess should really be
UpperLevel. Entire sections seem to be commented out and littered with
TODOs. If one is to take functions such as FindNextID and FindNextElement
at face value, what then is the purpose of SkipData?
What is the state of these two projects? These TODOs and broken behavior
have survived for a long time; will they ever be fixed, or are users
expected to work around them as it seems they have been doing so far?
My apologies that this sounds so inflamatory. I'm just bewildered that
these libraries are in this state.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Matroska-devel