FS-8053 addtl touchups
This commit is contained in:
parent
36cd926981
commit
52afedf23d
|
@ -752,6 +752,7 @@ typedef enum {
|
||||||
SWITCH_RTP_FLAG_MUTE,
|
SWITCH_RTP_FLAG_MUTE,
|
||||||
SWITCH_RTP_FLAG_NACK,
|
SWITCH_RTP_FLAG_NACK,
|
||||||
SWITCH_RTP_FLAG_TMMBR,
|
SWITCH_RTP_FLAG_TMMBR,
|
||||||
|
SWITCH_RTP_FLAG_GEN_TS_DELTA,
|
||||||
SWITCH_RTP_FLAG_INVALID
|
SWITCH_RTP_FLAG_INVALID
|
||||||
} switch_rtp_flag_t;
|
} switch_rtp_flag_t;
|
||||||
|
|
||||||
|
|
|
@ -3264,13 +3264,27 @@ void conference_video_write_frame(conference_obj_t *conference, conference_membe
|
||||||
|
|
||||||
switch_core_session_rwunlock(isession);
|
switch_core_session_rwunlock(isession);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (want_refresh) {
|
||||||
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
|
switch_core_session_t *isession = imember->session;
|
||||||
|
|
||||||
|
if (!isession || switch_core_session_read_lock(isession) != SWITCH_STATUS_SUCCESS) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isession || !switch_channel_test_flag(imember->channel, CF_VIDEO) ) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_core_session_request_video_refresh(imember->session);
|
||||||
|
switch_core_session_rwunlock(isession);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch_mutex_unlock(conference->member_mutex);
|
switch_mutex_unlock(conference->member_mutex);
|
||||||
|
|
||||||
switch_img_free(&tmp_frame.img);
|
switch_img_free(&tmp_frame.img);
|
||||||
|
|
||||||
if (want_refresh && floor_holder->session) {
|
|
||||||
switch_core_session_request_video_refresh(floor_holder->session);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
|
switch_status_t conference_video_thread_callback(switch_core_session_t *session, switch_frame_t *frame, void *user_data)
|
||||||
|
@ -3286,6 +3300,9 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session,
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
|
||||||
|
return SWITCH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (switch_thread_rwlock_tryrdlock(member->conference->rwlock) != SWITCH_STATUS_SUCCESS) {
|
if (switch_thread_rwlock_tryrdlock(member->conference->rwlock) != SWITCH_STATUS_SUCCESS) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
|
|
|
@ -302,8 +302,11 @@ void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, void *ob
|
||||||
|
|
||||||
if (imember->video_media_flow == SWITCH_MEDIA_FLOW_SENDONLY) {
|
if (imember->video_media_flow == SWITCH_MEDIA_FLOW_SENDONLY) {
|
||||||
conference_utils_member_clear_flag(imember, MFLAG_CAN_BE_SEEN);
|
conference_utils_member_clear_flag(imember, MFLAG_CAN_BE_SEEN);
|
||||||
|
conference_video_find_floor(imember, SWITCH_FALSE);
|
||||||
} else {
|
} else {
|
||||||
conference_utils_member_set_flag(imember, MFLAG_CAN_BE_SEEN);
|
conference_utils_member_set_flag(imember, MFLAG_CAN_BE_SEEN);
|
||||||
|
conference_video_find_floor(imember, SWITCH_TRUE);
|
||||||
|
switch_core_session_request_video_refresh(imember->session);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5958,6 +5958,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_activate_rtp(switch_core_sessi
|
||||||
flags[SWITCH_RTP_FLAG_BYTESWAP] = 0;
|
flags[SWITCH_RTP_FLAG_BYTESWAP] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((val = switch_channel_get_variable(session->channel, "rtp_gen_ts_delta")) && switch_true(val)) {
|
||||||
|
flags[SWITCH_RTP_FLAG_GEN_TS_DELTA] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (a_engine->rtp_session && switch_channel_test_flag(session->channel, CF_REINVITE)) {
|
if (a_engine->rtp_session && switch_channel_test_flag(session->channel, CF_REINVITE)) {
|
||||||
//const char *ip = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
|
//const char *ip = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_IP_VARIABLE);
|
||||||
//const char *port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
|
//const char *port = switch_channel_get_variable(session->channel, SWITCH_LOCAL_MEDIA_PORT_VARIABLE);
|
||||||
|
|
|
@ -6999,8 +6999,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TMP DISABLE DFF */
|
|
||||||
if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
|
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
|
/* 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*
|
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*
|
||||||
*/
|
*/
|
||||||
|
@ -7010,7 +7010,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc) {
|
if (!rtp_session->ts_norm.last_ssrc || send_msg->header.ssrc != rtp_session->ts_norm.last_ssrc) {
|
||||||
//#define USE_DELTA
|
#define USE_DELTA
|
||||||
#ifdef USE_DELTA
|
#ifdef USE_DELTA
|
||||||
if (rtp_session->ts_norm.last_ssrc) {
|
if (rtp_session->ts_norm.last_ssrc) {
|
||||||
rtp_session->ts_norm.delta_ct = 1;
|
rtp_session->ts_norm.delta_ct = 1;
|
||||||
|
@ -7028,10 +7028,8 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||||
if (ntohl(send_msg->header.ts) != rtp_session->ts_norm.last_frame) {
|
if (ntohl(send_msg->header.ts) != rtp_session->ts_norm.last_frame) {
|
||||||
#ifdef USE_DELTA
|
#ifdef USE_DELTA
|
||||||
int32_t delta = (int32_t) (ntohl(send_msg->header.ts) - rtp_session->ts_norm.last_frame);
|
int32_t delta = (int32_t) (ntohl(send_msg->header.ts) - rtp_session->ts_norm.last_frame);
|
||||||
if (delta > 0 && delta < 90000) {
|
|
||||||
rtp_session->ts_norm.delta = delta;
|
rtp_session->ts_norm.delta = delta;
|
||||||
}
|
|
||||||
//printf("WTF %d\n", rtp_session->ts_norm.delta);
|
|
||||||
rtp_session->ts_norm.ts += rtp_session->ts_norm.delta;
|
rtp_session->ts_norm.ts += rtp_session->ts_norm.delta;
|
||||||
#else
|
#else
|
||||||
switch_core_timer_sync(&rtp_session->timer);
|
switch_core_timer_sync(&rtp_session->timer);
|
||||||
|
|
Loading…
Reference in New Issue