mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-01 11:02:53 +00:00
FS-11057: [mod_conference] CPU race on personal canvas #resolve
This commit is contained in:
parent
52ac19c338
commit
89770f4522
@ -1418,13 +1418,8 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s
|
|||||||
float sdiv = 0;
|
float sdiv = 0;
|
||||||
int fdiv = 0;
|
int fdiv = 0;
|
||||||
int force_w = 0, force_h = 0;
|
int force_w = 0, force_h = 0;
|
||||||
|
conference_member_t *imember;
|
||||||
|
|
||||||
if (!conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING)) {
|
|
||||||
stream->write_function(stream, "-ERR Bandwidth control not available.\n");
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!argv[2]) {
|
if (!argv[2]) {
|
||||||
stream->write_function(stream, "-ERR Invalid input\n");
|
stream->write_function(stream, "-ERR Invalid input\n");
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
@ -1485,6 +1480,18 @@ switch_status_t conference_api_sub_vid_bandwidth(conference_obj_t *conference, s
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch_mutex_lock(conference->member_mutex);
|
switch_mutex_lock(conference->member_mutex);
|
||||||
|
|
||||||
|
for (imember = conference->members; imember; imember = imember->next) {
|
||||||
|
|
||||||
|
if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO_READY)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch_core_media_set_outgoing_bitrate(imember->session, SWITCH_MEDIA_TYPE_VIDEO, video_write_bandwidth);
|
||||||
|
|
||||||
|
stream->write_function(stream, "+OK Set Bandwidth %d kps for member %s\n", video_write_bandwidth, switch_channel_get_name(imember->channel));
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i <= conference->canvas_count; i++) {
|
for (i = 0; i <= conference->canvas_count; i++) {
|
||||||
if (i > -1 && i != id - 1) {
|
if (i > -1 && i != id - 1) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -829,14 +829,18 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
|
|||||||
|
|
||||||
if ((var = switch_channel_get_variable(member->channel, "rtp_video_max_bandwidth_out"))) {
|
if ((var = switch_channel_get_variable(member->channel, "rtp_video_max_bandwidth_out"))) {
|
||||||
member->max_bw_out = switch_parse_bandwidth_string(var);
|
member->max_bw_out = switch_parse_bandwidth_string(var);
|
||||||
|
|
||||||
if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) {
|
if (member->max_bw_out < conference->video_codec_settings.video.bandwidth) {
|
||||||
conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING);
|
conference_utils_member_set_flag_locked(member, MFLAG_NO_MINIMIZE_ENCODING);
|
||||||
switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out);
|
//switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, member->max_bw_out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (conference->video_codec_settings.video.bandwidth) {
|
||||||
|
switch_core_media_set_outgoing_bitrate(member->session, SWITCH_MEDIA_TYPE_VIDEO, conference->video_codec_settings.video.bandwidth);
|
||||||
|
}
|
||||||
|
|
||||||
switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id);
|
switch_channel_set_variable_printf(channel, "conference_member_id", "%d", member->id);
|
||||||
switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false");
|
switch_channel_set_variable_printf(channel, "conference_moderator", "%s", conference_utils_member_test_flag(member, MFLAG_MOD) ? "true" : "false");
|
||||||
switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false");
|
switch_channel_set_variable_printf(channel, "conference_ghost", "%s", conference_utils_member_test_flag(member, MFLAG_GHOST) ? "true" : "false");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user