Browse Source

Use fresh capture PTS after discarded video and diagnose rejected frames

master
evgeny 5 days ago
parent
commit
f055f8a9df
  1. 6
      src/call/call_video_transport.c
  2. 5
      tests/test_call.c

6
src/call/call_video_transport.c

@ -226,7 +226,11 @@ int call_video_send_frame(struct UTUN_INSTANCE *inst, const struct call_video_fr
if (!v || !call_video_format_valid(&f->format) || !f->data || !f->size || f->size > CALL_VIDEO_MAX_FRAME
|| f->offset || f->length != f->size || !f->frame_id || f->pts_us < 0 || f->pts_us > INT64_MAX / 2
|| (f->flags & ~CALL_VIDEO_KEY) || f->frame_id <= v->tx_last_id || f->pts_us <= v->tx_last_pts) {
DEBUG_WARN(DEBUG_CATEGORY_CALL, "video TX invalid frame/session"); return -1;
DEBUG_WARN(DEBUG_CATEGORY_CALL,
"video TX invalid active=%d call=%llu frame=%llu last_frame=%llu pts=%lld last_pts=%lld size=%u offset=%u length=%u format_valid=%d",
v != NULL, (unsigned long long)(f ? f->call_id : 0), (unsigned long long)(f ? f->frame_id : 0),
(unsigned long long)(v ? v->tx_last_id : 0), (long long)(f ? f->pts_us : -1), (long long)(v ? v->tx_last_pts : -1),
f ? f->size : 0, f ? f->offset : 0, f ? f->length : 0, f && call_video_format_valid(&f->format)); return -1;
}
if (!v->have_peer || v->acknowledged_revision != v->local_revision) { v->need_key = 1; return 0; }
if (!call_video_format_supported(&v->local, &v->peer, &f->format)) {

5
tests/test_call.c

@ -597,7 +597,7 @@ static void call_tick(void* arg) {
if (call_video_configure_rate(A, t->call_id, &f.format, 350000, 400000) != -1) {
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "video envelope changed without new generation"); t->result = 2; break;
}
f.format.generation = f.frame_id = 4;
f = video_test_frame(t->call_id, 4); f.format.maximum_bps = 3000000;
if (call_video_configure_rate(A, t->call_id, &f.format, 350000, 400000) || call_video_send_frame(A, &f) != 1) {
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "video failed to replace withdrawn envelope"); t->result = 2; break;
}
@ -639,6 +639,9 @@ static void call_tick(void* arg) {
}
if (t->phase == P_DONE) { t->result = 1; uasync_stop(t->ua); return; }
if (t->result == 2) {
DEBUG_ERROR(DEBUG_CATEGORY_CALL, "call test failed in phase=%d", t->phase); uasync_stop(t->ua); return;
}
if (++t->ticks > MAX_TICKS) {
fprintf(stderr, "test: timeout in phase %d (A_conn=%d B_conn=%d evA:inc=%d acc=%d end=%d dec=%d evB:inc=%d acc=%d end=%d dec=%d)\n",

Loading…
Cancel
Save