Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle global elements as a list of EbmlCallbacks #278

Open
robUx4 opened this issue Feb 26, 2024 · 0 comments
Open

Handle global elements as a list of EbmlCallbacks #278

robUx4 opened this issue Feb 26, 2024 · 0 comments
Labels
api-break breaks the API (e.g. programs using it will have to adjust their source code)

Comments

@robUx4
Copy link
Contributor

robUx4 commented Feb 26, 2024

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.

@robUx4 robUx4 added the api-break breaks the API (e.g. programs using it will have to adjust their source code) label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-break breaks the API (e.g. programs using it will have to adjust their source code)
Projects
None yet
Development

No branches or pull requests

1 participant