[vlc-devel] [PATCH 1/5] mp4: prhd, equi, cbmp and st3d boxes have a flag parameter

Francois Cartegnie fcvlcdev at free.fr
Mon Dec 5 12:01:23 CET 2016


Le 05/12/2016 à 11:49, Adrien Maglo a écrit :

> aligned(8) class ProjectionDataBox(unsigned int(32) proj_type, unsigned
> int(32) version, unsigned int(32) flags)
>     extends FullBox(proj_type, version, flags) {
> }
> 
> made me think the last 4 bytes were just for the flags even if it is not
> a definition of "FullBox" itself.
> 
>> You just need to check version and flags, if meaningful, according to
>> the spec, before decoding. There's no need to store it.
> 
> Is this a standard behaviour for MP4 in general? I do not find it
> described in this spec and I do not know what acceptable version numbers
> and flags would be.
> 
> Anyway, I have absolutely no strong opinion on this. I am just trying to
> understand. Just let me know what is the best way of fixing the reading
> of those boxes and I will follow your way.


14496-12 ha always degined fullbox has:

aligned(8) class FullBox(unsigned int(32) boxtype, unsigned int(8) v,
bit(24) f)
extends Box(boxtype) {
unsigned int(8)
 version = v;
bit(24)
 flags = f;
}

The google spec is misleading with truncated parameters when inheriting it.

aligned(8) class ProjectionDataBox(unsigned int(32) proj_type, unsigned
int(32) version, unsigned int(32) flags)
    extends FullBox(proj_type, version, flags) {
}

There's no more than 8+24 bits for both version and flags, which is a
whole 32bits.

To fix reading, if your version does not match the spec (==0), you need
to abort parsing because content is undefined.

Francois


More information about the vlc-devel mailing list