Expose nonblocking call clock access through both mutexes
This commit is contained in:
1 parent
562bdf54a6
commit
9ca0e61361
2 files changed
+10
No files matched your search
@@ -577,6 +577,13 @@ int call_audio_get_clock(uint64_t call_id, int64_t now_us, struct call_clock_sna
|
||||
return present ? 0 : -1;
|
||||
}
|
||||
|
||||
int call_audio_try_clock(uint64_t call_id, int64_t now_us, struct call_clock_snapshot* out) {
|
||||
memset(out, 0, sizeof(*out)); out->pts_us = -1;
|
||||
if (pthread_mutex_trylock(&g_mtx)) return 0;
|
||||
int result = g_active && call_id == g_call_id && g_vj ? call_jitter_try_clock(g_vj, now_us, out) : -1;
|
||||
pthread_mutex_unlock(&g_mtx); return result;
|
||||
}
|
||||
|
||||
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));
|
||||
|
||||
@@ -72,6 +72,9 @@ 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,
|
||||
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);
|
||||
/* Планировщик: 1 — снимок получен (valid может быть 0), 0 — одна из блокировок занята,
|
||||
* -1 — звонка нет. out обязателен. BUSY не означает invalid и не сдвигает видеорасписание. */
|
||||
int call_audio_try_clock(uint64_t call_id, int64_t now_us, struct call_clock_snapshot* out);
|
||||
/* Playback worker: старый аппаратный якорь недействителен до progress нового выхода. PCM/JB сохраняются. */
|
||||
void call_audio_suspend_device(uint64_t call_id, uint64_t epoch);
|
||||
/* Любой поток: диагностический снимок без потребления событий CALL_STATS. */
|
||||
|
||||
Reference in new issue
Block a user