|
|
|
|
@ -1,20 +1,20 @@
|
|
|
|
|
/* Общий таймер показа видео, один владелец — RX worker. Изображениями не владеет.
|
|
|
|
|
* poll вызывается для первого готового decoded кадра; next — следующий готовый кадр или NULL. |
|
|
|
|
* SHOW/DROP потребляют первый кадр, WAIT сохраняет его. Подача decoder продолжается независимо от WAIT. |
|
|
|
|
* SHOW/DROP_ORDER потребляют первый кадр, WAIT сохраняет его. Decoder работает по свободным output-буферам. |
|
|
|
|
* received_us ставится на входе RX port, до ожидания worker; все локальные времена — MONOTONIC, не BOOTTIME. |
|
|
|
|
* Поздний poll не сдвигает расписание. Сдвиги разрешены только доступностью данных и границами A/V. |
|
|
|
|
* После паузы расписание продолжается от фактического показа; долг снимается ускорением без пропусков. |
|
|
|
|
* Невалидные аудиочасы снимают привязку, но не очищают decoder/очередь и не меняют порядок PTS. */ |
|
|
|
|
#ifndef CALL_VIDEO_PLAYOUT_H |
|
|
|
|
#define CALL_VIDEO_PLAYOUT_H |
|
|
|
|
#include <stdint.h> |
|
|
|
|
#include "call_clock.h" |
|
|
|
|
#ifdef __cplusplus |
|
|
|
|
extern "C" { |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
struct call_video_playout_frame { int64_t pts_us, received_us; }; |
|
|
|
|
enum call_video_playout_action { |
|
|
|
|
CALL_VIDEO_PLAYOUT_WAIT, CALL_VIDEO_PLAYOUT_SHOW, CALL_VIDEO_PLAYOUT_DROP_LATE, |
|
|
|
|
CALL_VIDEO_PLAYOUT_DROP_SCHEDULE, CALL_VIDEO_PLAYOUT_DROP_ORDER |
|
|
|
|
CALL_VIDEO_PLAYOUT_WAIT, CALL_VIDEO_PLAYOUT_SHOW, CALL_VIDEO_PLAYOUT_DROP_ORDER |
|
|
|
|
}; |
|
|
|
|
struct call_video_playout { |
|
|
|
|
uint64_t call_id; |
|
|
|
|
@ -22,8 +22,8 @@ struct call_video_playout {
|
|
|
|
|
int64_t last_pts, last_deadline, deadline_us; |
|
|
|
|
int64_t report_us, last_show_us, interval_min, interval_max, av_min, av_max, dispatch_max, data_shift; |
|
|
|
|
int64_t last_show_pts, last_received, gap_pts, gap_received, gap_dispatch; |
|
|
|
|
int64_t late_av_min, late_av_max, late_age_min, late_age_max; // A/V и возраст от RX до пропуска за окно сводки.
|
|
|
|
|
unsigned shown, late, skipped, order, audio_wait, clock_wait; |
|
|
|
|
uint32_t speed_ppm; // Темп аудио + коррекция отставания, максимум 1.6x.
|
|
|
|
|
unsigned shown, order, audio_wait, clock_wait; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
int64_t call_video_playout_now_us(void); |
|
|
|
|
@ -33,7 +33,7 @@ void call_video_playout_init(struct call_video_playout *p, uint64_t call_id);
|
|
|
|
|
* source_epoch не участвует: коррекция аудио не означает разрыв видеокодека. */ |
|
|
|
|
enum call_video_playout_action call_video_playout_poll(struct call_video_playout *p, |
|
|
|
|
const struct call_video_playout_frame *frame, const struct call_video_playout_frame *next, |
|
|
|
|
int64_t now_us, int audio_valid, int64_t audio_pts_us); |
|
|
|
|
int64_t now_us, const struct call_clock_snapshot *audio); |
|
|
|
|
#ifdef __cplusplus |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|