janus: request camera key frame every 2 seconds

This commit is contained in:
Maxim Devaev
2026-08-23 12:56:12 +03:00
parent 84dc156b4a
commit 27096fc20c
2 changed files with 8 additions and 0 deletions

View File

@@ -171,11 +171,17 @@ void us_janus_client_recv(us_janus_client_s *client, janus_plugin_rtp *packet) {
retry = true;
// fall through
case US_RUR_DEPACKETIZATION_FAILED:
client->last_key_req_ts = us_get_now_monotonic();
client->gw->send_pli(client->session);
break;
}
} while (retry);
}
const ldf now_ts = us_get_now_monotonic();
if (client->last_key_req_ts + 2 < now_ts) {
client->last_key_req_ts = now_ts;
client->gw->send_pli(client->session);
}
} else {
if (header->type == US_RTP_OPUS_PAYLOAD && atomic_load(&client->transmit_aplay)) {
if (seq >= client->aplay_seq_next || (client->aplay_seq_next - seq) > 50) {

View File

@@ -64,6 +64,8 @@ typedef struct {
us_rtpc_s *rtpc;
us_ring_s *vplay_enc_ring;
ldf last_key_req_ts;
US_LIST_DECLARE;
} us_janus_client_s;