From bc92a8bf4a1226aca2ed51ebb84feba77bfe1cd2 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 18 Jun 2015 13:01:42 -0500 Subject: [PATCH] add auto bandwidth for conference config --- src/mod/applications/mod_conference/mod_conference.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 7d264cd5a0..eb2116cf5e 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -12976,10 +12976,6 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c conference->broadcast_chat_messages = broadcast_chat_messages; - if (video_codec_bandwidth) { - conference->video_codec_settings.video.bandwidth = switch_parse_bandwidth_string(video_codec_bandwidth); - } - conference->conf_video_mode = conf_video_mode; if (!switch_core_has_video() && (conference->conf_video_mode == CONF_VIDEO_MODE_MUX || conference->conf_video_mode == CONF_VIDEO_MODE_TRANSCODE)) { @@ -13035,6 +13031,14 @@ static conference_obj_t *conference_new(char *name, conf_xml_cfg_t cfg, switch_c conference_set_fps(conference, 30); } + if (video_codec_bandwidth) { + if (!strcasecmp(video_codec_bandwidth, "auto")) { + conference->video_codec_settings.video.bandwidth = switch_calc_bitrate(canvas_w, canvas_h, 2, conference->video_fps.fps); + } else { + conference->video_codec_settings.video.bandwidth = switch_parse_bandwidth_string(video_codec_bandwidth); + } + } + if (zstr(video_layout_name)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No video-layout-name specified, using " CONFERENCE_MUX_DEFAULT_LAYOUT "\n"); video_layout_name = CONFERENCE_MUX_DEFAULT_LAYOUT;