code wiki / (root) / nx_mediafacts.nx

nx_mediafacts.nx

buildroot/runtime/nx_mediafacts.nx

11272 B253 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_mediafacts.nx -- CLI for media fact extraction into the refcorpus measured-facts plane. nx_mediafacts probe <file> print the closed-vocabulary facts for ONE file (measurement only, nothing journaled) nx_mediafacts sweep <listfile> <source> <provenance> <license> [put] measure every path in <listfile> (one path per line), aggregate per format into DISTRIBUTION facts (count / min / median / max), print them; with the `put` verb each row goes through rc_put_row IN-PROCESS -- the same admission walls the refcorpus gate proves, incl. the k-anonymity floor: a bucket with fewer than 8 files is REFUSED, so a "distribution" that could describe one creator's asset physically cannot be journaled. Composes: nx_mediafacts_lib (extraction core) + nx_refcorpus (admission + journal, the import-with-main precedent proven by nx_refcorpus_gate). Bounded window read: only the first MF_WINDOW bytes of a file are ever mapped -- facts live in headers, and a 500MB video costs the same read as a thumbnail. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_mediafacts_lib.nx nx_refcorpus.nx nx_mediafacts.nx

imports: nx_syscalls.nxnx_mediafacts_lib.nxnx_refcorpus.nx

imported by: nobody (leaf or entry point)

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

main mfc_e sys_write mfc_slen sys_exit sys_mmap mfc_read_window sys_openat_rd sys_read sys_close mf_probe mf_format mf_b mf_wav mf_u32le mf_b ↻ mf_u16le sys_mmap ↻ nx_img_dims _be32 _le16 _le24 _le32b _be16 mf_jpeg_exif mf_b ↻ mf_u16be mfc_print_probe mfc_w sys_write ↻ mfc_slen ↻ mfc_fmtname mfc_num sys_write ↻ sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻

structs

none

consts

21const MF_WINDOW: i64 = 1048576
22const MF_MAX_FILES: i64 = 4096
23const MF_PATH_MAX: i64 = 384

functions

25func mfc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: mfc_wmfc_e
26func mfc_w(s: *u8) -> i64 { sys_write(1, s, mfc_slen(s)); return 0 }
27func mfc_e(s: *u8) -> i64 { sys_write(2, s, mfc_slen(s)); return 0 }
called by 1: main calls 2: sys_writemfc_slen
28func mfc_num(v: i64) -> i64
42func mfc_itoa(v: i64, out: *u8) -> i64
called by 1: mfc_dist_row calls 1: sys_mmap
56func mfc_fmtname(f: i64) -> *u8
66func mfc_read_window(path: *u8, buf: *u8) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
81func mfc_print_probe(facts: *i64) -> i64
called by 1: main calls 3: mfc_wmfc_fmtnamemfc_num
96func mfc_dist_row(fmt: i64, metric: *u8, val: i64, unit: *u8, cnt: i64, src: *u8, prov: *u8, lic: *u8, do_put: i64) -> i64
115func mfc_bucket(fmt: i64, cnt: i64, ws: *i64, hs: *i64, rates: *i64, chans: *i64, src: *u8, prov: *u8, lic: *u8, do_put: i64, wrote: *i64) -> i64
called by 1: main calls 2: mfc_dist_rowmf_median
149func main(argc: i64, argv: *i64) -> i64