FS-8293 make conference video quality configurable with video-quality param NEEDS DOC

This commit is contained in:
Anthony Minessale 2015-11-25 16:01:34 -06:00
parent 060641f220
commit 874aaf7a99
3 changed files with 15 additions and 4 deletions

View File

@ -1923,7 +1923,7 @@ void conference_video_check_auto_bitrate(conference_member_t *member, mcu_layer_
int max = 0;
if (layer) {
kps = switch_calc_bitrate(w, h, 2, (int)(member->conference->video_fps.fps));
kps = switch_calc_bitrate(w, h, member->conference->video_quality, (int)(member->conference->video_fps.fps));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps to accomodate %dx%d resolution\n",
switch_channel_get_name(member->channel), kps, layer->screen_w, layer->screen_h);
}

View File

@ -2410,6 +2410,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
char *video_codec_bandwidth = NULL;
char *no_video_avatar = NULL;
conference_video_mode_t conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH;
int conference_video_quality = 1;
float fps = 15.0f;
uint32_t max_members = 0;
uint32_t announce_count = 0;
@ -2721,6 +2722,15 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
terminate_on_silence = val;
} else if (!strcasecmp(var, "endconf-grace-time") && !zstr(val)) {
endconference_grace_time = val;
} else if (!strcasecmp(var, "video-quality") && !zstr(val)) {
int tmp = atoi(val);
if (tmp > 0 && tmp < 5) {
conference_video_quality = tmp;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Video quality must be between 1 and 4\n");
}
} else if (!strcasecmp(var, "video-mode") && !zstr(val)) {
if (!strcasecmp(val, "passthrough")) {
conference_video_mode = CONF_VIDEO_MODE_PASSTHROUGH;
@ -2789,8 +2799,8 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
conference->caller_controls = switch_core_strdup(conference->pool, caller_controls);
conference->moderator_controls = switch_core_strdup(conference->pool, moderator_controls);
conference->broadcast_chat_messages = broadcast_chat_messages;
conference->video_quality = conference_video_quality;
conference->conference_video_mode = conference_video_mode;
if (!switch_core_has_video() && (conference->conference_video_mode == CONF_VIDEO_MODE_MUX || conference->conference_video_mode == CONF_VIDEO_MODE_TRANSCODE)) {
@ -2864,7 +2874,7 @@ conference_obj_t *conference_new(char *name, conference_xml_cfg_t cfg, switch_co
if (video_codec_bandwidth) {
if (!strcasecmp(video_codec_bandwidth, "auto")) {
conference->video_codec_settings.video.bandwidth = switch_calc_bitrate(canvas_w, canvas_h, 2, (int)conference->video_fps.fps);
conference->video_codec_settings.video.bandwidth = switch_calc_bitrate(canvas_w, canvas_h, conference->video_quality, (int)conference->video_fps.fps);
} else {
conference->video_codec_settings.video.bandwidth = switch_parse_bandwidth_string(video_codec_bandwidth);
}

View File

@ -560,6 +560,7 @@ typedef struct conference_obj {
char *video_letterbox_bgcolor;
char *no_video_avatar;
conference_video_mode_t conference_video_mode;
int video_quality;
int members_with_video;
int members_with_avatar;
switch_codec_settings_t video_codec_settings;