Acknowledge Android texture consumption before presenting the next frame
This commit is contained in:
1 parent
13f09cfc20
commit
486d3314ef
5 files changed
+26
-8
No files matched your search
@@ -243,7 +243,8 @@ int call_video_port_send(const struct call_video_frame *frames, unsigned count)
|
||||
uint32_t bytes = 0;
|
||||
for (unsigned i = 0; i < count; ++i) {
|
||||
const struct call_video_frame *f = &frames[i];
|
||||
if (!f->data || !f->size || f->size > CALL_VIDEO_MAX_FRAME - bytes || f->offset || f->length != f->size
|
||||
if (!f->data || !f->size || f->size > CALL_VIDEO_MAX_FRAME || f->size > CALL_VIDEO_PORT_TX_BYTES - bytes
|
||||
|| f->offset || f->length != f->size
|
||||
|| f->call_id != frames[0].call_id || !call_video_same_format(&f->format, &frames[0].format)
|
||||
|| (i && (f->frame_id <= frames[i - 1].frame_id || f->pts_us <= frames[i - 1].pts_us))) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "video port invalid TX batch frame=%u count=%u bytes=%u", i, count, bytes); return -1;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Один платформенный видеозвонок процесса. Attach/detach — uasync; остальные API
|
||||
* потокобезопасны. Detach отменяет post до уничтожения ядра. Worker не хранит inst.
|
||||
* Один TX mailbox (готовая пачка до восьми кадров <=2MiB) + восемь RX кадров <=4MiB;
|
||||
* Один TX mailbox (до восьми кадров, каждый <=2MiB) + восемь RX кадров <=4MiB;
|
||||
* владение pull.data передаётся через u_free. TX не ждёт накопления пачки.
|
||||
* Никаких callbacks в UI: status/pull читает worker. Кодирование не блокирует uasync. */
|
||||
#ifndef CALL_VIDEO_PORT_H
|
||||
@@ -28,6 +28,7 @@ int call_video_port_status(uint64_t id, struct call_video_port_status *out);
|
||||
int call_video_port_format(uint64_t id, const struct call_video_format *format, uint32_t bps);
|
||||
int call_video_port_applied(uint64_t id, uint64_t generation, uint64_t request, uint32_t bps);
|
||||
#define CALL_VIDEO_PORT_TX_FRAMES 8u
|
||||
#define CALL_VIDEO_PORT_TX_BYTES (CALL_VIDEO_PORT_TX_FRAMES * CALL_VIDEO_MAX_FRAME)
|
||||
/* Атомарно копирует готовую пачку одного звонка. 1 — принята целиком, 0 — mailbox занят,
|
||||
* -1 — ошибка; на 0/-1 ни один кадр не принят. count: 1..CALL_VIDEO_PORT_TX_FRAMES. */
|
||||
int call_video_port_send(const struct call_video_frame *frames, unsigned count);
|
||||
|
||||
Reference in new issue
Block a user