mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-08-31 23:31:56 +00:00
janus: request camera key frame every 2 seconds
This commit is contained in:
@@ -171,11 +171,17 @@ void us_janus_client_recv(us_janus_client_s *client, janus_plugin_rtp *packet) {
|
|||||||
retry = true;
|
retry = true;
|
||||||
// fall through
|
// fall through
|
||||||
case US_RUR_DEPACKETIZATION_FAILED:
|
case US_RUR_DEPACKETIZATION_FAILED:
|
||||||
|
client->last_key_req_ts = us_get_now_monotonic();
|
||||||
client->gw->send_pli(client->session);
|
client->gw->send_pli(client->session);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (retry);
|
} 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 {
|
} else {
|
||||||
if (header->type == US_RTP_OPUS_PAYLOAD && atomic_load(&client->transmit_aplay)) {
|
if (header->type == US_RTP_OPUS_PAYLOAD && atomic_load(&client->transmit_aplay)) {
|
||||||
if (seq >= client->aplay_seq_next || (client->aplay_seq_next - seq) > 50) {
|
if (seq >= client->aplay_seq_next || (client->aplay_seq_next - seq) > 50) {
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ typedef struct {
|
|||||||
us_rtpc_s *rtpc;
|
us_rtpc_s *rtpc;
|
||||||
us_ring_s *vplay_enc_ring;
|
us_ring_s *vplay_enc_ring;
|
||||||
|
|
||||||
|
ldf last_key_req_ts;
|
||||||
|
|
||||||
US_LIST_DECLARE;
|
US_LIST_DECLARE;
|
||||||
} us_janus_client_s;
|
} us_janus_client_s;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user