ietf-wg-cellar / ebml-specification

the specification for the EBML format
Creative Commons Attribution 4.0 International
70 stars 24 forks source link

Element range attribute excludes the Binary type #423

Open hubblec4 opened 1 year ago

hubblec4 commented 1 year ago

Currently the range attribute is allowed only for numerical element types, but Matroska has two Binary elements with a definde range.

https://github.com/ietf-wg-cellar/matroska-specification/issues/730

robUx4 commented 1 year ago

Indeed, either we don't use the range field or we change the rules here. The text is pretty clear that it's only for "number" values: https://www.rfc-editor.org/rfc/rfc8794.html#expression-of-range

I think the idea of the range field, rather than just being rules written in the text, is that they are machine readable and parseable, to generate code accordingly. It becomes tricky to describe with that field for complex binary blobs, which EBML or Matroska are not supposed to interpret on their own.

So in the spirit of the separation of parsing levels, I would not put binary ranges inside the range field but in the text or in the usage notes.

hubblec4 commented 1 year ago

I would not put binary ranges inside the range field but in the text or in the usage notes.

OK. Sounds logical and I think usage notes could be enough for the moment.

Would a new range-attribute makes sense, -> range_binary ?

robUx4 commented 1 year ago

It would not be machine readable. Binary data are not meant to be interpreted at the EBML level. And you can't easily say bit 4 must be set if bit 19-20 are going to be used. It's just impractical a the EBML and Matroska levels.