|
|
|
|
@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
|
|
#include <stdint.h> |
|
|
|
|
#include "call_jitter.h" |
|
|
|
|
#include "call_clock.h" |
|
|
|
|
|
|
|
|
|
struct UTUN_INSTANCE; |
|
|
|
|
|
|
|
|
|
@ -42,7 +43,8 @@ int call_is_online(struct UTUN_INSTANCE* inst, const char* ch_id, uint64_t peer
|
|
|
|
|
|
|
|
|
|
/* Отправить закодированный Opus-кадр пиру (оборачивает в CALL_MEDIA).
|
|
|
|
|
* Только когда звонок ACTIVE. seq/ts выставляются автоматически. */ |
|
|
|
|
int call_send_media(struct UTUN_INSTANCE* inst, uint64_t call_id, const uint8_t* opus, int len); |
|
|
|
|
int call_send_media(struct UTUN_INSTANCE* inst, uint64_t call_id, const uint8_t* opus, int len, |
|
|
|
|
const struct call_capture_time* timing); |
|
|
|
|
|
|
|
|
|
/* Коллбэк приёма медиа: вызывается в uasync-потоке на каждый Opus-кадр пира.
|
|
|
|
|
* Используется headless-аудио-сокетом (и в фазе 3 — декодером GUI). */ |
|
|
|
|
@ -58,7 +60,7 @@ void call_set_media_recv_cb(struct UTUN_INSTANCE* inst, call_media_recv_fn fn, v
|
|
|
|
|
struct call_audio_ops { |
|
|
|
|
/* uasync-поток: принятый Opus-кадр пира (декод + jitter-буфер). */ |
|
|
|
|
void (*on_media)(struct UTUN_INSTANCE* inst, uint64_t call_id, |
|
|
|
|
uint16_t seq, uint32_t ts_ms, const uint8_t* opus, int len); |
|
|
|
|
uint16_t seq, uint32_t ts_ms, const uint8_t* opus, int len, const struct call_capture_time* timing); |
|
|
|
|
/* uasync-поток: текущие метрики джиттер-буфера (buffer_ms, tempo_x100,
|
|
|
|
|
* dropped/underruns — опционально, NULL допустим). */ |
|
|
|
|
int (*get_stats)(uint64_t call_id, int* buffer_ms, int* tempo_x100, |
|
|
|
|
@ -71,6 +73,7 @@ struct call_media_arg {
|
|
|
|
|
struct UTUN_INSTANCE* inst; |
|
|
|
|
uint64_t call_id; |
|
|
|
|
uint16_t len; |
|
|
|
|
struct call_capture_time timing; |
|
|
|
|
uint8_t opus[256]; |
|
|
|
|
}; |
|
|
|
|
void call_send_media_trampoline(void* arg); |
|
|
|
|
|