FS-10091: [mod_conference] Conference play file with full-screen=true has side effect on member video #resolve

This commit is contained in:
Anthony Minessale 2017-07-20 17:24:17 -05:00
parent ef74427b3e
commit 0013b00b64
2 changed files with 24 additions and 19 deletions

View File

@ -105,6 +105,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
canvas->send_keyframe = 1; canvas->send_keyframe = 1;
canvas->overlay_video_file = 0; canvas->overlay_video_file = 0;
} }
canvas->play_file = 0;
} }
return switch_core_file_close(&node->fh); return switch_core_file_close(&node->fh);

View File

@ -2482,7 +2482,9 @@ void conference_video_fnode_check(conference_file_node_t *fnode, int canvas_id)
} }
if (full_screen) { if (full_screen) {
canvas->play_file = 1; if (canvas->play_file == 0) {
canvas->play_file = 1;
}
if (fnode->fh.mm.fmt == SWITCH_IMG_FMT_ARGB) { if (fnode->fh.mm.fmt == SWITCH_IMG_FMT_ARGB) {
canvas->overlay_video_file = 1; canvas->overlay_video_file = 1;
} else { } else {
@ -3864,16 +3866,15 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
write_img = canvas->img; write_img = canvas->img;
timestamp = canvas->timer.samplecount; timestamp = canvas->timer.samplecount;
if (canvas->play_file == 1) {
canvas->send_keyframe = 1;
canvas->play_file = -1;
}
switch_mutex_lock(conference->file_mutex); switch_mutex_lock(conference->file_mutex);
if (conference->fnode && switch_test_flag(&conference->fnode->fh, SWITCH_FILE_OPEN)) { if (conference->fnode && switch_test_flag(&conference->fnode->fh, SWITCH_FILE_OPEN)) {
if (canvas->overlay_video_file) { if (canvas->overlay_video_file) {
if (switch_core_file_read_video(&conference->fnode->fh, &write_frame, SVR_FLUSH) == SWITCH_STATUS_SUCCESS) { if (switch_core_file_read_video(&conference->fnode->fh, &write_frame, SVR_FLUSH) == SWITCH_STATUS_SUCCESS) {
if (canvas->play_file) {
canvas->send_keyframe = 1;
canvas->play_file = 0;
}
switch_img_free(&file_img); switch_img_free(&file_img);
switch_img_fit(&write_frame.img, canvas->img->d_w, canvas->img->d_h, SWITCH_FIT_SIZE); switch_img_fit(&write_frame.img, canvas->img->d_w, canvas->img->d_h, SWITCH_FIT_SIZE);
file_img = write_frame.img; file_img = write_frame.img;
@ -3907,24 +3908,25 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
} }
//switch_core_timer_sync(&canvas->timer); //switch_core_timer_sync(&canvas->timer);
timestamp = canvas->timer.samplecount; //timestamp = canvas->timer.samplecount;
} else if (file_img) { } else if (file_img) {
write_img = file_img; write_img = file_img;
} }
} else if (canvas->playing_video_file) { } else if (canvas->playing_video_file) {
if (switch_core_file_read_video(&conference->fnode->fh, &write_frame, SVR_FLUSH) == SWITCH_STATUS_SUCCESS) { if (switch_core_file_read_video(&conference->fnode->fh, &write_frame, SVR_FLUSH) == SWITCH_STATUS_SUCCESS) {
switch_image_t *tmp = NULL;
if (canvas->play_file) {
canvas->send_keyframe = 1;
canvas->play_file = 0;
}
switch_img_free(&file_img); switch_img_free(&file_img);
switch_img_fit(&write_frame.img, canvas->img->d_w, canvas->img->d_h, SWITCH_FIT_SIZE); switch_img_letterbox(write_frame.img, &tmp, canvas->img->d_w, canvas->img->d_h, "#000000");
file_img = write_img = write_frame.img; if (tmp) {
switch_img_free(&write_frame.img);
file_img = write_img = write_frame.img = tmp;
} else {
file_img = write_img = write_frame.img;
}
//switch_core_timer_sync(&canvas->timer); //switch_core_timer_sync(&canvas->timer);
timestamp = canvas->timer.samplecount; //timestamp = canvas->timer.samplecount;
} else if (file_img) { } else if (file_img) {
write_img = file_img; write_img = file_img;
} }
@ -3936,7 +3938,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
write_frame.img = write_img; write_frame.img = write_img;
wait_for_canvas(canvas); if (!canvas->playing_video_file && !canvas->overlay_video_file) {
wait_for_canvas(canvas);
}
if (canvas->recording) { if (canvas->recording) {
conference_video_check_recording(conference, canvas, &write_frame); conference_video_check_recording(conference, canvas, &write_frame);