Browse Source

Provide call audio diagnostics without consuming stats events

master
evgeny 5 days ago
parent
commit
f341d1db4b
  1. 10
      src/call/call_audio.c
  2. 2
      src/call/call_audio.h

10
src/call/call_audio.c

@ -557,6 +557,16 @@ int call_audio_get_clock(uint64_t call_id, int64_t now_us, struct call_clock_sna
return present ? 0 : -1; return present ? 0 : -1;
} }
int call_audio_get_diagnostics(uint64_t call_id, struct call_jitter_diagnostics* out) {
if (!out) { DEBUG_ERROR(DEBUG_CATEGORY_CALL, "call diagnostics: missing output"); return -1; }
memset(out, 0, sizeof(*out));
pthread_mutex_lock(&g_mtx);
int present = g_active && call_id == g_call_id && g_vj;
if (present) call_jitter_get_diagnostics(g_vj, out, 0);
pthread_mutex_unlock(&g_mtx);
return present ? 0 : -1;
}
/* ── uasync-поток: метрики ── */ /* ── uasync-поток: метрики ── */
int call_audio_get_stats(uint64_t call_id, int* buffer_ms, int* tempo_x100, int call_audio_get_stats(uint64_t call_id, int* buffer_ms, int* tempo_x100,

2
src/call/call_audio.h

@ -72,6 +72,8 @@ void call_audio_on_media(struct UTUN_INSTANCE* inst, uint64_t call_id,
void call_audio_playback_progress(uint64_t call_id, uint64_t epoch, uint64_t position, void call_audio_playback_progress(uint64_t call_id, uint64_t epoch, uint64_t position,
int64_t at_us, int64_t now_us, int measured); int64_t at_us, int64_t now_us, int measured);
int call_audio_get_clock(uint64_t call_id, int64_t now_us, struct call_clock_snapshot* out); int call_audio_get_clock(uint64_t call_id, int64_t now_us, struct call_clock_snapshot* out);
/* Любой поток: диагностический снимок без потребления событий CALL_STATS. */
int call_audio_get_diagnostics(uint64_t call_id, struct call_jitter_diagnostics* out);
/* uasync-поток: метрики джиттер-буфера для CALL_STATS (dropped/underruns — необязательные). */ /* uasync-поток: метрики джиттер-буфера для CALL_STATS (dropped/underruns — необязательные). */
int call_audio_get_stats(uint64_t call_id, int* buffer_ms, int* tempo_x100, int call_audio_get_stats(uint64_t call_id, int* buffer_ms, int* tempo_x100,

Loading…
Cancel
Save