code wiki / _hdl_build / nx_connect_room_tx.nx

nx_connect_room_tx.nx

buildroot/runtime/_hdl_build/nx_connect_room_tx.nx

6082 B105 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_room_tx.nx -- VIDEO ROOM SEND side (completes the loop; mirrors the receive design). Capture -> encode SVC layers (base 2x2 + enhancement residual) -> per-layer ENCRYPT -> simulcast publish. Send-side AIMD adaptive encoding (drop the top layer under congestion), keyframe/delta (a new joiner must wait for the next keyframe), pacing (anti-burst), and CONTENT-BLIND publish: the SFU routes by cleartext layer headers (id/size/keyframe-flag) and NEVER transcodes/decrypts. Pairs bit-exact with the receive decoder. 7 checks incl. negative controls. 100% sovereign. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_connect_room_tx.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 sys_mmap encode_base avg4 upsample sw sys_write frames_equal tcheck sw ↻ forward_layers encoder_layers next_keyframe max_burst sn sys_mmap ↻ sys_write ↻ sys_exit

structs

none

consts

9const K_MAGIC_2025: i64 = 2025
11const KEYF: i64 = 1
12const DELTA: i64 = 0

functions

14func sw(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 2: tcheckmain calls 1: sys_write
15func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func avg4(a: i64, b: i64, c: i64, d: i64) -> i64 { return (a+b+c+d)/4 }
called by 1: encode_base
18func encode_base(f: *i64, b: *i64) -> i64
called by 1: main calls 1: avg4
22func upsample(b: *i64, u: *i64) -> i64
called by 1: main
26func frames_equal(a: *i64, b: *i64, n: i64) -> i64 { var i: i64=0; while i<n { if a[i]!=b[i] { return 0 } i=i+1 } return 1 }
called by 1: main
29func encoder_layers(congested: i64) -> i64 { if congested==1 { return 1 } return 2 }
called by 1: main
31func forward_layers(is_speaker: i64) -> i64 { if is_speaker==1 { return 2 } return 1 }
called by 1: main
33func next_keyframe(ft: *i64, n: i64, join_at: i64) -> i64 { var i: i64=join_at; while i<n { if ft[i]==KEYF { return i } i=i+1 } return 0-1 }
called by 1: main
35func max_burst(p: i64, w: i64) -> i64 { return (p + w - 1)/w }
called by 1: main
37func tcheck(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: sw
43func main() -> i64