static void conference_set_video_floor_holder(conference_obj_t *conference, conference_member_t *member, switch_bool_t force)
{
switch_event_t *event;
- conference_member_t *old_member = NULL;
+ conference_member_t *old_member = NULL, *imember = NULL;
int old_id = 0;
if (!member) {
switch_mutex_lock(conference->mutex);
if (!member) {
- conference_member_t *imember;
-
for (imember = conference->members; imember; imember = imember->next) {
if (imember != conference->video_floor_holder && imember->channel && switch_channel_test_flag(imember->channel, CF_VIDEO)) {
member = imember;
//switch_channel_clear_flag(old_member->channel, CF_VIDEO_PASSIVE);
}
+ for (imember = conference->members; imember; imember = imember->next) {
+ if (!imember->channel || !switch_channel_test_flag(imember->channel, CF_VIDEO)) {
+ continue;
+ }
+ switch_channel_clear_flag(imember->channel, CF_VIDEO_ECHO);
+
+ if (imember == conference->video_floor_holder) {
+ switch_channel_set_flag(imember->channel, CF_VIDEO_PASSIVE);
+ } else {
+ switch_channel_clear_flag(imember->channel, CF_VIDEO_PASSIVE);
+ }
+ switch_core_session_refresh_video(imember->session);
+ }
+
switch_set_flag(conference, CFLAG_FLOOR_CHANGE);
switch_mutex_unlock(conference->mutex);
switch_channel_set_flag(channel, CF_CONFERENCE);
switch_channel_set_flag(channel, CF_VIDEO_PASSIVE);
+
if (switch_channel_answer(channel) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Channel answer failed.\n");
goto end;
#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--
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 };
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();
}
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);
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);