code wiki / (root) / nx_mp4_probe.nx

nx_mp4_probe.nx

buildroot/runtime/nx_mp4_probe.nx

5015 B92 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind probetopic mp4
docsdependenciesstructsconstsfunctions

about

nx_mp4_probe.nx -- SOVEREIGN MP4/fMP4 box-tree validator (no ffmpeg, no strings|grep). Walks the ISO-BMFF box tree in the header region of a file, printing type/size/offset per box and recursing into containers (moov/trak/mdia/minf/stbl/mvex/moof/traf) + the sample-entry boxes (stsd/avc1/mp4a), flagging any box whose declared size is malformed. Stops at the first mdat (its payload is opaque). Confirms track count + codec boxes (avc1/avcC, mp4a/esds) + first-fragment traf count. Used to verify nx_ts2fmp4 output. Usage: nx_mp4_probe <file.mp4>. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_mp4_probe.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main mp sys_write sys_openat_rd sys_mmap sys_read sys_close mn sys_mmap ↻ sys_write ↻ walk be32 be64 mind mp ↻ mp ↻ mn ↻ ptype sys_write ↻ is4 iscont is4 ↻ walk ↻

structs

none

consts

9const RDCAP: i64 = 2097152

functions

11func mp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: mindwalkmain calls 1: sys_write
12func mn(v: i64) -> i64
called by 2: walkmain calls 2: sys_mmapsys_write
20func mind(d: i64) -> i64 { var k: i64=0; while k<d { mp(" " as *u8); k=k+1 } return 0 }
called by 1: walk calls 1: mp
21func be32(b: *u8, o: i64) -> i64 { return ((b[o] as i64)<<24)|((b[o+1] as i64)<<16)|((b[o+2] as i64)<<8)|(b[o+3] as i64) }
called by 1: walk
22func is4(b: *u8, o: i64, s: *u8) -> i64 { if b[o]==s[0] { if b[o+1]==s[1] { if b[o+2]==s[2] { if b[o+3]==s[3] { return 1 } } } } return 0 }
called by 2: iscontwalk
23func ptype(b: *u8, o: i64) -> i64 { sys_write(1, ((b as i64)+o) as *u8, 4); return 0 }
called by 1: walk calls 1: sys_write
24func iscont(b: *u8, o: i64) -> i64
called by 1: walk calls 1: is4
39func be64(b: *u8, o: i64) -> i64
called by 1: walk
45func walk(b: *u8, start: i64, end: i64, depth: i64, st: *i64) -> i64
called by 2: walkmain calls 9: be32be64mindmpmnptype+3
77func main(argc: i64, argv: *i64) -> i64