Exercise video switching and backpressure in a real call

This commit is contained in:
evgeny committed 2026-10-14 20:49:54 +02:00
1 parent b466ec30e3
commit 996d4a89f5
2 files changed
+77 -2

No files matched your search

+2 -1
View File
@@ -76,7 +76,8 @@ static void flush(struct call_video_transport *v) {
uint8_t wire[CALL_VIDEO_HEADER_BYTES + CALL_VIDEO_FRAGMENT_BYTES];
// Ограниченный burst одного вызова; повторяется по audio send и таймеру 50мс.
for (unsigned budget = 0; v->data && budget < 16; budget++) {
if (!etcp_router_send_q_has_room(s->ctx->inst, s->group_id, s->peer_node_id, ETCP_RT_ID_CALL_VIDEO)) return;
if (!etcp_router_send_q_has_room(s->ctx->inst, s->group_id, s->peer_node_id, ETCP_RT_ID_CALL_VIDEO)
|| queue_entry_count(conn->send_q) >= ROUTER_MAX_SEND_Q_PACKETS) return;
uint32_t remaining = v->tx.size - v->tx.offset;
v->tx.length = remaining < CALL_VIDEO_FRAGMENT_BYTES ? remaining : CALL_VIDEO_FRAGMENT_BYTES;
v->tx.data = v->data + v->tx.offset;