FS-5959
This commit is contained in:
parent
20038230d4
commit
ccaa3ae732
|
@ -668,6 +668,8 @@ typedef enum {
|
|||
SWITCH_RTP_FLAG_KILL_JB,
|
||||
SWITCH_RTP_FLAG_VIDEO_BREAK,
|
||||
SWITCH_RTP_FLAG_PAUSE,
|
||||
SWITCH_RTP_FLAG_FIR,
|
||||
SWITCH_RTP_FLAG_PLI,
|
||||
SWITCH_RTP_FLAG_INVALID
|
||||
} switch_rtp_flag_t;
|
||||
|
||||
|
|
|
@ -1245,19 +1245,19 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
|
|||
|
||||
case SWITCH_MESSAGE_INDICATE_VIDEO_REFRESH_REQ:
|
||||
{
|
||||
const char *pl = "<media_control><vc_primitive><to_encoder><picture_fast_update/></to_encoder></vc_primitive></media_control>";
|
||||
time_t now = switch_epoch_time_now(NULL);
|
||||
const char *pl = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<media_control>\n<vc_primitive>\n<to_encoder>\n<picture_fast_update>\n</picture_fast_update>\n</to_encoder>\n</vc_primitive>\n</media_control>";
|
||||
//time_t now = switch_epoch_time_now(NULL);
|
||||
|
||||
if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 5) {
|
||||
|
||||
tech_pvt->last_vid_info = now;
|
||||
//if (!tech_pvt->last_vid_info || (now - tech_pvt->last_vid_info) > 5) {
|
||||
|
||||
// tech_pvt->last_vid_info = now;
|
||||
|
||||
if (!zstr(msg->string_arg)) {
|
||||
pl = msg->string_arg;
|
||||
}
|
||||
|
||||
nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/media_control+xml"), SIPTAG_PAYLOAD_STR(pl), TAG_END());
|
||||
}
|
||||
//}
|
||||
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -144,6 +144,10 @@ typedef struct switch_rtp_engine_s {
|
|||
|
||||
uint8_t reset_codec;
|
||||
uint8_t codec_negotiated;
|
||||
|
||||
uint8_t fir;
|
||||
uint8_t pli;
|
||||
|
||||
} switch_rtp_engine_t;
|
||||
|
||||
|
||||
|
@ -3435,8 +3439,19 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
|||
for (attr = m->m_attributes; attr; attr = attr->a_next) {
|
||||
if (!strcasecmp(attr->a_name, "framerate") && attr->a_value) {
|
||||
//framerate = atoi(attr->a_value);
|
||||
}
|
||||
if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value && !strcmp(attr->a_value, "1")) {
|
||||
} else if (!strcasecmp(attr->a_name, "rtcp-fb")) {
|
||||
if (!zstr(attr->a_value)) {
|
||||
if (switch_stristr("fir", attr->a_value)) {
|
||||
v_engine->fir++;
|
||||
}
|
||||
|
||||
if (switch_stristr("pli", attr->a_value)) {
|
||||
v_engine->pli++;
|
||||
}
|
||||
|
||||
smh->mparams->rtcp_video_interval_msec = "10000";
|
||||
}
|
||||
} else if (!strcasecmp(attr->a_name, "rtcp") && attr->a_value && !strcmp(attr->a_value, "1")) {
|
||||
switch_channel_set_variable(session->channel, "rtp_remote_video_rtcp_port", attr->a_value);
|
||||
v_engine->remote_rtcp_port = (switch_port_t)atoi(attr->a_value);
|
||||
} else if (!got_video_crypto && !strcasecmp(attr->a_name, "crypto") && !zstr(attr->a_value)) {
|
||||
|
@ -5095,6 +5110,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
|||
if (switch_rtp_ready(v_engine->rtp_session)) {
|
||||
const char *ssrc;
|
||||
|
||||
if (v_engine->fir) {
|
||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_FIR);
|
||||
}
|
||||
|
||||
if (v_engine->pli) {
|
||||
switch_rtp_set_flag(v_engine->rtp_session, SWITCH_RTP_FLAG_PLI);
|
||||
}
|
||||
|
||||
switch_rtp_set_payload_map(v_engine->rtp_session, &v_engine->payload_map);
|
||||
|
||||
start_video_thread(session);
|
||||
|
@ -6436,6 +6459,12 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if (v_engine->fir || v_engine->pli) {
|
||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf),
|
||||
"a=rtcp-fb:* %s%s\n", v_engine->fir ? "fir " : "", v_engine->pli ? "pli" : "");
|
||||
}
|
||||
|
||||
//switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "a=ssrc:%u\n", v_engine->ssrc);
|
||||
|
||||
if (v_engine->ice_out.cands[0][0].ready) {
|
||||
|
@ -6465,11 +6494,11 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
|||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "b=AS:%d\n", bw);
|
||||
}
|
||||
|
||||
if (vp8) {
|
||||
if (vp8 && switch_channel_test_flag(session->channel, CF_WEBRTC)) {
|
||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf),
|
||||
"a=rtcp-fb:%d ccm fir\n", vp8);
|
||||
}
|
||||
|
||||
|
||||
if (red) {
|
||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf),
|
||||
"a=rtcp-fb:%d nack\n", vp8);
|
||||
|
|
|
@ -1459,7 +1459,7 @@ static void send_fir(switch_rtp_t *rtp_session)
|
|||
}
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
static void send_pli(switch_rtp_t *rtp_session)
|
||||
{
|
||||
|
||||
|
@ -1542,7 +1542,7 @@ static void send_pli(switch_rtp_t *rtp_session)
|
|||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
|
||||
{
|
||||
|
@ -1557,8 +1557,11 @@ static int check_rtcp_and_ice(switch_rtp_t *rtp_session)
|
|||
}
|
||||
|
||||
if (rtp_session->fir_countdown == FIR_COUNTDOWN || rtp_session->fir_countdown == 1) {
|
||||
send_fir(rtp_session);
|
||||
//send_pli(rtp_session);
|
||||
if (rtp_session->flags[SWITCH_RTP_FLAG_PLI]) {
|
||||
send_pli(rtp_session);
|
||||
} else {
|
||||
send_fir(rtp_session);
|
||||
}
|
||||
}
|
||||
|
||||
rtp_session->fir_countdown--;
|
||||
|
@ -3460,9 +3463,9 @@ SWITCH_DECLARE(void) switch_rtp_flush(switch_rtp_t *rtp_session)
|
|||
|
||||
SWITCH_DECLARE(void) switch_rtp_video_refresh(switch_rtp_t *rtp_session)
|
||||
{
|
||||
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && rtp_session->ice.ice_user) {
|
||||
if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] &&
|
||||
(rtp_session->ice.ice_user || rtp_session->flags[SWITCH_RTP_FLAG_FIR] || rtp_session->flags[SWITCH_RTP_FLAG_PLI])) {
|
||||
if (!rtp_session->fir_countdown) {
|
||||
//send_fir(rtp_session);
|
||||
rtp_session->fir_countdown = FIR_COUNTDOWN;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue