FS-10007: [mod_conference] Issue with reservation-id and conference video layouts #resolve

This commit is contained in:
Anthony Minessale 2017-02-03 15:17:17 -06:00 committed by Brian West
parent b81d6990ee
commit d8c9b1ed16
2 changed files with 37 additions and 18 deletions

View File

@ -1722,6 +1722,7 @@ switch_status_t conference_api_sub_vid_res_id(conference_member_t *member, switc
}
stream->write_function(stream, "+OK reservation_id %s\n", text);
conference_video_detach_video_layer(member);
conference_video_find_floor(member, SWITCH_FALSE);
}

View File

@ -1948,6 +1948,7 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
{
uint32_t avatar_layers = 0;
mcu_layer_t *layer = NULL;
mcu_layer_t *xlayer;
int i;
if (conference_utils_test_flag(conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) &&
@ -1958,7 +1959,7 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
switch_mutex_lock(canvas->mutex);
for (i = 0; i < canvas->total_layers; i++) {
mcu_layer_t *xlayer = &canvas->layers[i];
xlayer = &canvas->layers[i];
if (xlayer->is_avatar && xlayer->member_id != (int)conference->video_floor_holder) {
avatar_layers++;
@ -1970,9 +1971,10 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
(avatar_layers && !member->avatar_png_img) || conference_utils_member_test_flag(member, MFLAG_MOD)) &&
(member->avatar_png_img || (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE))) {
/* find an empty layer */
for (i = 0; i < canvas->total_layers; i++) {
mcu_layer_t *xlayer = &canvas->layers[i];
xlayer = &canvas->layers[i];
if (xlayer->geometry.res_id) {
if (member->video_reservation_id && !strcmp(xlayer->geometry.res_id, member->video_reservation_id)) {
@ -1980,22 +1982,38 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
conference_video_attach_video_layer(member, canvas, i);
break;
}
} else if (xlayer->geometry.flooronly && !xlayer->fnode && !xlayer->geometry.fileonly) {
if (member->id == conference->video_floor_holder) {
layer = xlayer;
conference_video_attach_video_layer(member, canvas, i);
break;
}
} else if ((!xlayer->member_id || (!member->avatar_png_img &&
xlayer->is_avatar &&
(conference->canvas_count > 1 || xlayer->member_id != (int)conference->video_floor_holder))) &&
!xlayer->fnode && !xlayer->geometry.fileonly) {
switch_status_t lstatus;
lstatus = conference_video_attach_video_layer(member, canvas, i);
}
}
if (lstatus == SWITCH_STATUS_SUCCESS || lstatus == SWITCH_STATUS_BREAK) {
layer = xlayer;
break;
if (!layer) {
for (i = 0; i < canvas->total_layers; i++) {
xlayer = &canvas->layers[i];
if (xlayer->geometry.flooronly && !xlayer->fnode && !xlayer->geometry.fileonly && !xlayer->geometry.res_id) {
if (member->id == conference->video_floor_holder) {
layer = xlayer;
conference_video_attach_video_layer(member, canvas, i);
break;
}
}
}
}
if (!layer) {
for (i = 0; i < canvas->total_layers; i++) {
xlayer = &canvas->layers[i];
if ((!xlayer->member_id || (!member->avatar_png_img &&
xlayer->is_avatar &&
(conference->canvas_count > 1 || xlayer->member_id != (int)conference->video_floor_holder))) &&
!xlayer->fnode && !xlayer->geometry.fileonly && !xlayer->geometry.res_id && !xlayer->geometry.flooronly) {
switch_status_t lstatus = conference_video_attach_video_layer(member, canvas, i);
if (lstatus == SWITCH_STATUS_SUCCESS || lstatus == SWITCH_STATUS_BREAK) {
layer = xlayer;
break;
}
}
}
}
@ -2278,7 +2296,7 @@ static void wait_for_canvas(mcu_canvas_t *canvas)
mcu_layer_t *layer = &canvas->layers[i];
if (layer->need_patch) {
if (layer->member) {
if (layer->member_id && layer->member && conference_utils_member_test_flag(layer->member, MFLAG_RUNNING) && layer->member->fb) {
switch_frame_buffer_trypush(layer->member->fb, (void *) 1);
x++;
} else {