FS-7513 add manage-inbound-video-bitrate conference flag

This commit is contained in:
Anthony Minessale 2015-05-14 15:55:19 -05:00 committed by Michael Jerris
parent 4e141d0e51
commit b95390cba4
1 changed files with 19 additions and 1 deletions

View File

@ -262,7 +262,8 @@ typedef enum {
CFLAG_POSITIONAL = (1 << 23),
CFLAG_TRANSCODE_VIDEO = (1 << 24),
CFLAG_VIDEO_MUXING = (1 << 25),
CFLAG_MINIMIZE_VIDEO_ENCODING = (1 << 26)
CFLAG_MINIMIZE_VIDEO_ENCODING = (1 << 26),
CFLAG_MANAGE_INBOUND_VIDEO_BITRATE = (1 << 27)
} conf_flag_t;
typedef enum {
@ -1444,6 +1445,21 @@ static switch_status_t attach_video_layer(conference_member_t *member, int idx)
}
}
if (switch_test_flag(member->conference, CFLAG_MANAGE_INBOUND_VIDEO_BITRATE)) {
switch_core_session_message_t msg = { 0 };
int kps = switch_calc_bitrate(layer->screen_w, layer->screen_h, 2, member->conference->video_fps.fps);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "%s auto-setting bitrate to %dkps to accomidate %dx%d resolution\n",
switch_channel_get_name(member->channel), kps, layer->screen_w, layer->screen_h);
msg.message_id = SWITCH_MESSAGE_INDICATE_BITRATE_REQ;
msg.numeric_arg = kps * 1024;
msg.from = __FILE__;
switch_core_session_receive_message(member->session, &msg);
}
if (member->video_layer_id > -1) {
detach_video_layer(member);
}
@ -11336,6 +11352,8 @@ static void set_cflags(const char *flags, uint32_t *f)
*f |= CFLAG_POSITIONAL;
} else if (!strcasecmp(argv[i], "minimize-video-encoding")) {
*f |= CFLAG_MINIMIZE_VIDEO_ENCODING;
} else if (!strcasecmp(argv[i], "manage-inbound-video-bitrate")) {
*f |= CFLAG_MANAGE_INBOUND_VIDEO_BITRATE;
}