code wiki / (root) / nx_vid_dur_lib.nx

nx_vid_dur_lib.nx

buildroot/runtime/nx_vid_dur_lib.nx

5451 B105 linesdepth 2pulls 2 transitivereach 3 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_vid_dur_lib.nx -- SOVEREIGN container-duration parsers (no main -> build the _gate). Reads the raw container bytes (no external tool): mp4/mov/m4v via the moov->mvhd movie header (timescale + duration, integer), and mkv/webm via EBML Info->Duration (an IEEE float in TimecodeScale ticks). Returns dur in ms, or -1 if not found in the given window. Composes into nx_ts_dur so EVERY video format gets a runtime. license_tier: ORIGINAL

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_vid_dur_lib.nx nx_galx_durindex.nx nx_ts_dur.nx nx_vid_dur_gate.nx

imports: nx_syscalls.nx

imported by: nx_galx_durindex.nxnx_ts_dur.nxnx_vid_dur_gate.nx

structs

none

consts

7const K_MAGIC_86400000: i64 = 86400000
8const K_MAGIC_1000000: i64 = 1000000

functions

11func vd_find(buf: *u8, n: i64, pat: *u8, plen: i64) -> i64
21func vd_u32(buf: *u8, off: i64) -> i64 { return ((buf[off] as i64) << 24) | ((buf[off+1] as i64) << 16) | ((buf[off+2] as i64) << 8) | (buf[off+3] as i64) }
called by 1: vd_mp4_dur
22func vd_u64(buf: *u8, off: i64) -> i64 { var v: i64 = 0; var k: i64 = 0; while k < 8 { v = (v << 8) | (buf[off+k] as i64); k = k + 1 } return v }
called by 1: vd_mp4_dur
27func vd_mp4_dur(buf: *u8, n: i64) -> i64
47func vd_ieee64(buf: *u8, off: i64) -> i64
called by 2: mainvd_mkv_dur
60func vd_ieee32(buf: *u8, off: i64) -> i64
called by 1: vd_mkv_dur
77func vd_mkv_dur(buf: *u8, n: i64) -> i64
99func vd_sniff(buf: *u8, n: i64) -> i64
called by 3: extract_durmainmain calls 2: sys_mmapvd_find