-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Right now the global elements are hardcoded in each element description. EbmlXXX elements can only use the libebml global elements. KaxXXX can only use the libmatroska global elements (the libebml ones as we don't extend EBML).
This list is only used for reading. On writing the user has to add these elements manually, except for the CRC32 element which should not...
We should pass the list of global elements that can be read at any time in the bistream. They don't need to have a multiple or mandatory flag when reading. So we don't need an EbmlSemantic for that. A C++ container of EbmlCallbacks should be enough. Although there's no good one usable as a constexpr, apart from std::array, so we can pass it with a default parameter (with Void and Crc32 in the list).
It would also be good to be able to discard such element as a top level element. For EbmlCrc32 it doesn't even make sense and should not be created if it's not within an EbmlMaster. For Void it would trigger too many false positive when recovering data. That's why VLC uses a special context for the top level reading so it doesn't read those by mistake.