MPEGGroup / FileFormat

MPEG file format discussions
23 stars 0 forks source link

Clarify behavior for end of box data #46

Open cconcolato opened 2 years ago

cconcolato commented 2 years ago

As discussed in https://github.com/gpac/ComplianceWarden/issues/33, it could be useful to clarify that data may exist in boxes after the last declared field and clarify the processor behavior (consume, ignore, preserve?).

baumanj commented 2 years ago

I feel like this exact feature is covered by the expandable keyword from ISO/IEC 14496-1:2010 § 8.3.3 "Expandable classes". If this behavior is desired, shouldn't that be the mechanism? Without explicit intent, I feel like extra data is far more likely to be a mistake. In that case, I like indicating that readers may still ignore it, but writers shall not write it.

cconcolato commented 2 months ago

The current text reads:

Boxes specified in this document may be extended but such extensions are reserved for future use by ISO/IEC. Syntax may be added at the end of a box derived from FullBox and an already specified version value may be kept, if it is not essential to parse such added syntax. When a parser has not reached the end of a box derived from FullBox as defined by the values of the size or largesize field (as appropriate) but does not recognize the remaining syntax elements, it shall ignore and skip the remaining of the box.

It covers the case of FullBox but not of Box or other structures. I think we should generalize that text.

mhannuksela commented 2 months ago

Good point, @cconcolato. Here is a try. First define the term content box in Clause 3:

content box box that is not a container box

Then, rewrite the current text with reference to term content box:

Content boxes specified in this document may be extended but such extensions are reserved for future use by ISO/IEC. When it is not essential to parse a syntax extension of a content box, the syntax extension may be added at the end of the content box. When a content box is derived from FullBox and it is not essential to parse a syntax extension that is added at the end of the content box, an already specified version value of the content box may be kept. When a parser has not reached the end of a content box as defined by the values of the size or largesize field (as appropriate) but does not recognize the remaining syntax elements, it shall ignore and skip the remaining of the content box.

I am not sure what to write about other structures.

Should something be written about container boxes? E.g.: A parser shall skip a child box that it does not recognize.