nx_uxf_negotiate.nx
buildroot/runtime/nx_uxf_negotiate.nx
about
nx_uxf_negotiate.nx -- UXF arc B: ENDPOINT-ADAPTIVE capability negotiation -- "never a walled
garden, serve what the endpoint can consume" (Law-1/2). Given a stored media asset's
self-describing profile {container, vcodec, acodec} and an endpoint's declared capabilities
(data-driven, knowledge/registry/endpoint_caps.tsv), decide the EMIT PLAN:
DIRECT -- endpoint supports container + both codecs -> serve bytes unchanged.
REMUX -- both CODECS supported but CONTAINER not -> rewrap losslessly (NO re-encode).
This is the real "Chrome can't play MKV" fix: H.264/AAC-in-MKV -> MP4, lossless.
TRANSCODE -- a codec is unsupported -> must re-encode (lossy/expensive) -- the heavy downstream.
HONEST SCOPE: this organ builds + proves the PLAN (the negotiation). The actual remux/transcode
EXECUTION (container rewrap, codec re-encode) is the named heavy downstream, NOT faked here.
No hardware writes (Rule 26). license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_uxf_media_asset_test.nxnx_uxf_negotiate_test.nx
structs
| none |
consts
| 14 | const PLAN_DIRECT: i64 = 0 |
| 15 | const PLAN_REMUX: i64 = 1 |
| 16 | const PLAN_TRANSCODE: i64 = 2 |
functions
| 18 | func ng_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 21 | func ng_csv_has(list: *u8, token: *u8) -> i64 |
| 45 | func ng_streq_slice(buf: *u8, a: i64, b: i64, z: *u8) -> i64 |
| 53 | func ng_copy_slice(buf: *u8, a: i64, b: i64, dst: *u8) -> i64 called by 1: ng_caps_lookup |
| 61 | func ng_caps_lookup(tsv: *u8, n: i64, endpoint: *u8, out_cont: *u8, out_codec: *u8) -> i64 |
| 89 | func ng_negotiate(container: *u8, vcodec: *u8, acodec: *u8, ep_cont: *u8, ep_codec: *u8) -> i64 |