mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
revert FS-9368
This commit is contained in:
parent
6c0f18d960
commit
f34dac749e
@ -9157,9 +9157,16 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
|
||||
if (sip && sip->sip_content_type && sip->sip_content_type->c_type && sip->sip_content_type->c_subtype &&
|
||||
sip->sip_payload && sip->sip_payload->pl_data) {
|
||||
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "media_control+xml")) {
|
||||
switch_core_session_t *other_session;
|
||||
|
||||
if (switch_channel_test_flag(channel, CF_VIDEO)) {
|
||||
switch_core_media_gen_key_frame(session);
|
||||
switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ);
|
||||
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
|
||||
sofia_glue_build_vid_refresh_message(other_session, sip->sip_payload->pl_data);
|
||||
switch_core_session_rwunlock(other_session);
|
||||
} else {
|
||||
switch_channel_set_flag(channel, CF_VIDEO_REFRESH_REQ);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) &&
|
||||
|
@ -1926,15 +1926,6 @@ static void check_jb(switch_core_session_t *session, const char *input, int32_t
|
||||
switch_rtp_set_video_buffer_size(v_engine->rtp_session, frames, max_frames);
|
||||
}
|
||||
return;
|
||||
} else if (!strcasecmp(input, "vpause")) {
|
||||
switch_rtp_pause_jitter_buffer(v_engine->rtp_session, SWITCH_TRUE);
|
||||
return;
|
||||
} else if (!strcasecmp(input, "vresume")) {
|
||||
switch_rtp_pause_jitter_buffer(v_engine->rtp_session, SWITCH_FALSE);
|
||||
return;
|
||||
} else if (!strcasecmp(input, "vstop")) {
|
||||
switch_rtp_deactivate_jitter_buffer(v_engine->rtp_session);
|
||||
return;
|
||||
} else if (!strncasecmp(input, "vdebug:", 7)) {
|
||||
s = input + 7;
|
||||
|
||||
@ -2059,11 +2050,6 @@ static void check_jb_sync(switch_core_session_t *session)
|
||||
}
|
||||
|
||||
fps = switch_core_media_get_video_fps(session);
|
||||
|
||||
|
||||
if (switch_test_flag(smh, SMF_JB_PAUSED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch_rtp_get_video_buffer_size(v_engine->rtp_session, &min_frames, &max_frames, &cur_frames, NULL);
|
||||
|
||||
@ -2651,7 +2637,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_write_frame(switch_core_sessio
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
if (type == SWITCH_MEDIA_TYPE_AUDIO && !switch_test_flag(frame, SFF_CNG) && !switch_test_flag(frame, SFF_PROXY_PACKET)) {
|
||||
if (!switch_test_flag(frame, SFF_CNG) && !switch_test_flag(frame, SFF_PROXY_PACKET)) {
|
||||
if (engine->read_impl.encoded_bytes_per_packet) {
|
||||
bytes = engine->read_impl.encoded_bytes_per_packet;
|
||||
frames = ((int) frame->datalen / bytes);
|
||||
@ -9644,29 +9630,19 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
|
||||
case SWITCH_MESSAGE_INDICATE_BRIDGE:
|
||||
{
|
||||
|
||||
if (switch_rtp_ready(a_engine->rtp_session) || switch_rtp_ready(v_engine->rtp_session)) {
|
||||
if (switch_rtp_ready(a_engine->rtp_session)) {
|
||||
const char *val;
|
||||
|
||||
if (
|
||||
int ok = 0;
|
||||
|
||||
if (!switch_channel_test_flag(session->channel, CF_VIDEO) &&
|
||||
(!(val = switch_channel_get_variable(session->channel, "rtp_jitter_buffer_during_bridge")) || switch_false(val))) {
|
||||
if (switch_channel_test_flag(session->channel, CF_JITTERBUFFER) && switch_channel_test_cap_partner(session->channel, CC_FS_RTP)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
|
||||
"%s PAUSE Jitterbuffer\n", switch_channel_get_name(session->channel));
|
||||
if (a_engine->rtp_session) {
|
||||
switch_rtp_pause_jitter_buffer(a_engine->rtp_session, SWITCH_TRUE);
|
||||
}
|
||||
|
||||
if (v_engine->rtp_session) {
|
||||
switch_rtp_pause_jitter_buffer(v_engine->rtp_session, SWITCH_TRUE);
|
||||
}
|
||||
switch_rtp_pause_jitter_buffer(a_engine->rtp_session, SWITCH_TRUE);
|
||||
switch_set_flag(smh, SMF_JB_PAUSED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(a_engine->rtp_session)) {
|
||||
const char *val;
|
||||
int ok = 0;
|
||||
|
||||
if (switch_channel_test_flag(session->channel, CF_PASS_RFC2833) && switch_channel_test_flag_partner(session->channel, CF_FS_RTP)) {
|
||||
switch_rtp_set_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833);
|
||||
@ -9713,26 +9689,18 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_receive_message(switch_core_se
|
||||
}
|
||||
goto end;
|
||||
case SWITCH_MESSAGE_INDICATE_UNBRIDGE:
|
||||
|
||||
if (switch_rtp_ready(a_engine->rtp_session) || switch_rtp_ready(v_engine->rtp_session)) {
|
||||
if (switch_rtp_ready(a_engine->rtp_session)) {
|
||||
|
||||
if (switch_test_flag(smh, SMF_JB_PAUSED)) {
|
||||
switch_clear_flag(smh, SMF_JB_PAUSED);
|
||||
if (switch_channel_test_flag(session->channel, CF_JITTERBUFFER)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG,
|
||||
"%s RESUME Jitterbuffer\n", switch_channel_get_name(session->channel));
|
||||
if (a_engine->rtp_session) {
|
||||
switch_rtp_pause_jitter_buffer(a_engine->rtp_session, SWITCH_FALSE);
|
||||
}
|
||||
|
||||
if (v_engine->rtp_session) {
|
||||
switch_rtp_pause_jitter_buffer(v_engine->rtp_session, SWITCH_FALSE);
|
||||
}
|
||||
switch_rtp_pause_jitter_buffer(a_engine->rtp_session, SWITCH_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_rtp_ready(a_engine->rtp_session)) {
|
||||
|
||||
|
||||
if (switch_rtp_test_flag(a_engine->rtp_session, SWITCH_RTP_FLAG_PASS_RFC2833)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "%s deactivate passthru 2833 mode.\n",
|
||||
switch_channel_get_name(session->channel));
|
||||
@ -11454,7 +11422,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
|
||||
frame = &write_frame;
|
||||
frame->img = img;
|
||||
|
||||
|
||||
if (!switch_test_flag(frame, SFF_USE_VIDEO_TIMESTAMP)) {
|
||||
|
||||
if (!(timer = switch_core_media_get_timer(session, SWITCH_MEDIA_TYPE_VIDEO))) {
|
||||
@ -11469,7 +11436,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
|
||||
frame->timestamp = timer->samplecount;
|
||||
}
|
||||
|
||||
|
||||
switch_clear_flag(frame, SFF_SAME_IMAGE);
|
||||
frame->m = 0;
|
||||
|
||||
|
@ -4061,7 +4061,7 @@ SWITCH_DECLARE(switch_jb_t *) switch_rtp_get_jitter_buffer(switch_rtp_t *rtp_ses
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_pause_jitter_buffer(switch_rtp_t *rtp_session, switch_bool_t pause)
|
||||
{
|
||||
|
||||
if (!switch_rtp_ready(rtp_session) || (!rtp_session->jb && !rtp_session->vb)) {
|
||||
if (!switch_rtp_ready(rtp_session) || !rtp_session->jb) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
@ -4070,11 +4070,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_pause_jitter_buffer(switch_rtp_t *rtp
|
||||
}
|
||||
|
||||
if (rtp_session->pause_jb && !pause) {
|
||||
if (rtp_session->vb) {
|
||||
switch_jb_reset(rtp_session->vb);
|
||||
} else {
|
||||
switch_jb_reset(rtp_session->jb);
|
||||
}
|
||||
switch_jb_reset(rtp_session->jb);
|
||||
}
|
||||
|
||||
rtp_session->pause_jb = pause ? 1 : 0;
|
||||
@ -5650,7 +5646,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
||||
if (rtp_session->has_rtp && *bytes) {
|
||||
uint32_t read_ssrc = ntohl(rtp_session->last_rtp_hdr.ssrc);
|
||||
|
||||
if (rtp_session->vb && jb_valid(rtp_session) && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb && jb_valid(rtp_session)) {
|
||||
status = switch_jb_put_packet(rtp_session->vb, (switch_rtp_packet_t *) &rtp_session->recv_msg, *bytes);
|
||||
|
||||
if (status == SWITCH_STATUS_TOO_LATE) {
|
||||
@ -5745,7 +5741,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
||||
}
|
||||
}
|
||||
|
||||
if (rtp_session->vb && jb_valid(rtp_session) && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb && jb_valid(rtp_session)) {
|
||||
switch_status_t vstatus = switch_jb_get_packet(rtp_session->vb, (switch_rtp_packet_t *) &rtp_session->recv_msg, bytes);
|
||||
status = vstatus;
|
||||
|
||||
@ -6335,7 +6331,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
pt = 200000;
|
||||
}
|
||||
|
||||
if (rtp_session->vb && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb) {
|
||||
if (switch_jb_poll(rtp_session->vb)) {
|
||||
pt = 0;
|
||||
}
|
||||
@ -6344,12 +6340,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
if ((io_flags & SWITCH_IO_FLAG_NOBLOCK)) {
|
||||
pt = 0;
|
||||
}
|
||||
|
||||
|
||||
poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, pt);
|
||||
|
||||
|
||||
//if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
||||
// switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "WTF Poll %d %d\n", pt, poll_status);
|
||||
// switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "WTF Poll %d\n", poll_status);
|
||||
//}
|
||||
|
||||
if (!rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && rtp_session->dtmf_data.out_digit_dur > 0) {
|
||||
@ -6366,7 +6362,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
}
|
||||
|
||||
|
||||
if (poll_status == SWITCH_STATUS_SUCCESS || (rtp_session->vb && !rtp_session->pause_jb && switch_jb_poll(rtp_session->vb))) {
|
||||
if (poll_status == SWITCH_STATUS_SUCCESS || (rtp_session->vb && switch_jb_poll(rtp_session->vb))) {
|
||||
|
||||
got_rtp_poll = 1;
|
||||
|
||||
@ -7301,6 +7297,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_GEN_TS_DELTA) || switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
|
||||
/* Normalize the timestamps to our own base by generating a made up starting point then adding the measured deltas to that base
|
||||
so if the timestamps and ssrc of the source change, it will not break the other end's jitter bufffer / decoder etc *cough* CHROME *cough*
|
||||
|
Loading…
x
Reference in New Issue
Block a user