comparison src/twjit_in.c @ 11:4f82b9c07ddb

twjit: update to stats
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 06 Jul 2024 01:57:52 +0000
parents e60df79cbe9f
children 323957bebd53
comparison
equal deleted inserted replaced
10:e60df79cbe9f 11:4f82b9c07ddb
97 ts_delta = -ts_delta_clamp; 97 ts_delta = -ts_delta_clamp;
98 jitter_new = time_delta_tsu - ts_delta; 98 jitter_new = time_delta_tsu - ts_delta;
99 if (jitter_new < 0) 99 if (jitter_new < 0)
100 jitter_new = -jitter_new; 100 jitter_new = -jitter_new;
101 rri->jitter_accum += jitter_new - ((rri->jitter_accum + 8) >> 4); 101 rri->jitter_accum += jitter_new - ((rri->jitter_accum + 8) >> 4);
102 if (jitter_new > twjit->stats.jitter_max)
103 twjit->stats.jitter_max = jitter_new;
102 } 104 }
103 105
104 /* actual twjit input logic */ 106 /* actual twjit input logic */
105 107
106 static void 108 static void
244 analytics_cont(twjit, rx_seq, rx_ts, &now); 246 analytics_cont(twjit, rx_seq, rx_ts, &now);
245 twjit->last_ssrc = rx_ssrc; 247 twjit->last_ssrc = rx_ssrc;
246 twjit->last_seq = rx_seq; 248 twjit->last_seq = rx_seq;
247 twjit->last_ts = rx_ts; 249 twjit->last_ts = rx_ts;
248 memcpy(&twjit->last_arrival, &now, sizeof(struct timespec)); 250 memcpy(&twjit->last_arrival, &now, sizeof(struct timespec));
251 twjit->stats.rx_packets++;
249 msg->cb[0] = rx_ts; 252 msg->cb[0] = rx_ts;
250 253
251 switch (twjit->state) { 254 switch (twjit->state) {
252 case TWJIT_STATE_EMPTY: 255 case TWJIT_STATE_EMPTY:
253 /* first packet into totally empty buffer */ 256 /* first packet into totally empty buffer */
279 } 282 }
280 if (id == INPUT_RESET) { 283 if (id == INPUT_RESET) {
281 twjit->state = TWJIT_STATE_HANDOVER; 284 twjit->state = TWJIT_STATE_HANDOVER;
282 twjit->write_sb = !twjit->write_sb; 285 twjit->write_sb = !twjit->write_sb;
283 init_subbuf_first_packet(twjit, msg, rx_ssrc, rx_ts); 286 init_subbuf_first_packet(twjit, msg, rx_ssrc, rx_ts);
284 twjit->stats.handovers++; 287 twjit->stats.handovers_in++;
285 return; 288 return;
286 } 289 }
287 insert_pkt_write_sb(twjit, msg, rx_ts); 290 insert_pkt_write_sb(twjit, msg, rx_ts);
288 return; 291 return;
289 default: 292 default: