code wiki / (root) / nx_jitter_buffer.nx

nx_jitter_buffer.nx

buildroot/runtime/nx_jitter_buffer.nx

5293 B127 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_jitter_buffer.nx -- Adaptive jitter buffer for smooth video playback by reordering packets and adjusting delay based on network jitter.

dependencies 0 imports · 1 importers

nx_jitter_buffer.nx nx_jitter_buffer_gate.nx

imports: none

imported by: nx_jitter_buffer_gate.nx

structs

none

consts

2const JB_MAGIC_3550: i64 = 3550
14const JB_NEXT: i64 = 0 // next seq to release
15const JB_TARGET: i64 = 1 // adaptive playout delay (us)
16const JB_JITTER: i64 = 2 // EWMA interarrival jitter (us)
17const JB_PREVTS: i64 = 3
18const JB_PREVARR: i64 = 4
19const JB_BASE: i64 = 5 // base delay floor (us)
20const JB_ANCHTS: i64 = 6 // ts of the frame that anchored playout
21const JB_ANCHPLAY: i64 = 7 // playout-clock time the anchor is released
22const JB_STARTED: i64 = 8
23const JB_COUNT: i64 = 9
24const JB_HAVEPREV: i64 = 10

functions

26func jb_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: jb_push
28func jb_init(st: *i64, base_delay_us: i64) -> i64
called by 1: run_trace
44func jb_push(st: *i64, slots: *i64, N: i64, seq: i64, ts_us: i64, arr_us: i64) -> i64
called by 1: run_trace calls 1: jb_abs
72func jb_pop(st: *i64, slots: *i64, N: i64, now_us: i64, out: *i64) -> i64
called by 1: run_trace
124func jb_target_delay(st: *i64) -> i64 { return st[JB_TARGET] }
called by 1: run_trace
125func jb_jitter(st: *i64) -> i64 { return st[JB_JITTER] }
127func main() -> i64 { return 0 }