mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-10 11:50:53 +00:00
fix vid switching in webrtc
This commit is contained in:
1 parent
230e005a08
commit
850c154bd4
2 files changed
+35
-15
No files matched your search
+19
-12
@@ -54,7 +54,7 @@
|
||||
#include <switch_version.h>
|
||||
#include <switch_ssl.h>
|
||||
|
||||
#define FIR_COUNTDOWN 50
|
||||
#define FIR_COUNTDOWN 25
|
||||
|
||||
#define READ_INC(rtp_session) switch_mutex_lock(rtp_session->read_mutex); rtp_session->reading++
|
||||
#define READ_DEC(rtp_session) switch_mutex_unlock(rtp_session->read_mutex); rtp_session->reading--
|
||||
@@ -1527,6 +1527,20 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
|
||||
int rtcp_ok = 1;
|
||||
switch_time_t now = switch_micro_time_now();
|
||||
|
||||
|
||||
if (rtp_session->fir_countdown) {
|
||||
if (rtp_session->fir_countdown == FIR_COUNTDOWN) {
|
||||
do_flush(rtp_session, SWITCH_TRUE);
|
||||
}
|
||||
|
||||
if (rtp_session->fir_countdown == FIR_COUNTDOWN || rtp_session->fir_countdown == 1) {
|
||||
send_fir(rtp_session);
|
||||
//send_pli(rtp_session);
|
||||
}
|
||||
|
||||
rtp_session->fir_countdown--;
|
||||
}
|
||||
|
||||
if (rtp_session->flags[SWITCH_RTP_FLAG_AUTO_CNG] && rtp_session->send_msg.header.ts &&
|
||||
rtp_session->timer.samplecount >= (rtp_session->last_write_samplecount + (rtp_session->samples_per_interval * 60))) {
|
||||
uint8_t data[10] = { 0 };
|
||||
@@ -4621,8 +4635,10 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
pt = 100000;
|
||||
}
|
||||
|
||||
|
||||
poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, pt);
|
||||
|
||||
|
||||
|
||||
if (rtp_session->dtmf_data.out_digit_dur > 0) {
|
||||
return_cng_frame();
|
||||
}
|
||||
@@ -5282,15 +5298,6 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_zerocopy_read_frame(switch_rtp_t *rtp
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (rtp_session->fir_countdown) {
|
||||
rtp_session->fir_countdown--;
|
||||
|
||||
if (rtp_session->fir_countdown == FIR_COUNTDOWN / 2 || rtp_session->fir_countdown == 0) {
|
||||
send_fir(rtp_session);
|
||||
//send_pli(rtp_session);
|
||||
}
|
||||
}
|
||||
|
||||
bytes = rtp_common_read(rtp_session, &frame->payload, &frame->flags, io_flags);
|
||||
|
||||
frame->data = RTP_BODY(rtp_session);
|
||||
@@ -5524,7 +5531,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||
rtp_session->ts_norm.delta_percent = (double)((double)rtp_session->ts_norm.delta / (double)rtp_session->ts_norm.delta_avg) * 100.0f;
|
||||
|
||||
|
||||
if (rtp_session->ts_norm.delta_ct > 50 && rtp_session->ts_norm.delta_percent > 125.0) {
|
||||
if (rtp_session->ts_norm.delta_ct > 50 && rtp_session->ts_norm.delta_percent > 150.0) {
|
||||
//printf("%s diff %d %d (%.2f)\n", switch_core_session_get_name(rtp_session->session),
|
||||
//rtp_session->ts_norm.delta, rtp_session->ts_norm.delta_avg, rtp_session->ts_norm.delta_percent);
|
||||
switch_rtp_video_refresh(rtp_session);
|
||||
|
||||
Reference in new issue
Block a user