mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-19 01:34:13 +00:00
FS-8909 FS-8914
This commit is contained in:
1 parent
f7c6241f8c
commit
f39c9e009b
9 files changed
+157
-120
No files matched your search
@@ -91,7 +91,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
|
||||
conference_al_close(node->al);
|
||||
}
|
||||
#endif
|
||||
if (conference->playing_video_file && switch_core_file_has_video(&node->fh) && conference->canvases[0] && node->canvas_id > -1) {
|
||||
if (conference->playing_video_file && switch_core_file_has_video(&node->fh, SWITCH_FALSE) && conference->canvases[0] && node->canvas_id > -1) {
|
||||
if (conference->canvases[node->canvas_id]->timer.timer_interface) {
|
||||
conference->canvases[node->canvas_id]->timer.interval = conference->video_fps.ms;
|
||||
conference->canvases[node->canvas_id]->timer.samples = conference->video_fps.samples;
|
||||
|
||||
@@ -1586,7 +1586,7 @@ void conference_video_check_recording(conference_obj_t *conference, mcu_canvas_t
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_test_flag((&imember->rec->fh), SWITCH_FILE_OPEN) && switch_core_file_has_video(&imember->rec->fh)) {
|
||||
if (switch_test_flag((&imember->rec->fh), SWITCH_FILE_OPEN) && switch_core_file_has_video(&imember->rec->fh, SWITCH_TRUE)) {
|
||||
switch_core_file_write_video(&imember->rec->fh, frame);
|
||||
}
|
||||
}
|
||||
@@ -1696,7 +1696,7 @@ void conference_video_patch_fnode(mcu_canvas_t *canvas, conference_file_node_t *
|
||||
void conference_video_fnode_check(conference_file_node_t *fnode, int canvas_id) {
|
||||
mcu_canvas_t *canvas = NULL;
|
||||
|
||||
if (switch_core_file_has_video(&fnode->fh) && switch_core_file_read_video(&fnode->fh, NULL, SVR_CHECK) == SWITCH_STATUS_BREAK) {
|
||||
if (switch_core_file_has_video(&fnode->fh, SWITCH_TRUE) && switch_core_file_read_video(&fnode->fh, NULL, SVR_CHECK) == SWITCH_STATUS_BREAK) {
|
||||
int full_screen = 0;
|
||||
char *res_id = NULL;
|
||||
|
||||
@@ -2220,13 +2220,13 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||
do_refresh = 100;
|
||||
}
|
||||
|
||||
if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh)) {
|
||||
if (conference->async_fnode && switch_core_file_has_video(&conference->async_fnode->fh, SWITCH_TRUE)) {
|
||||
check_async_file = 1;
|
||||
file_count++;
|
||||
files_playing = 1;
|
||||
}
|
||||
|
||||
if (conference->fnode && switch_core_file_has_video(&conference->fnode->fh)) {
|
||||
if (conference->fnode && switch_core_file_has_video(&conference->fnode->fh, SWITCH_TRUE)) {
|
||||
check_file = 1;
|
||||
file_count++;
|
||||
files_playing = 1;
|
||||
|
||||
@@ -358,7 +358,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
|
||||
switch_buffer_zero(audio_buffer);
|
||||
|
||||
if (switch_core_file_has_video(&fh)) {
|
||||
if (switch_core_file_has_video(&fh, SWITCH_FALSE)) {
|
||||
flush_video_queue(source->video_q);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
}
|
||||
}
|
||||
|
||||
if (title && (source->cover_art || switch_core_file_has_video(&fh))) {
|
||||
if (title && (source->cover_art || switch_core_file_has_video(&fh, SWITCH_TRUE))) {
|
||||
const char *format = "#cccccc:#333333:FreeSans.ttf:3%:";
|
||||
|
||||
if (artist) {
|
||||
@@ -466,7 +466,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
}
|
||||
|
||||
|
||||
if (switch_core_file_has_video(&source->chime_fh)) {
|
||||
if (switch_core_file_has_video(&source->chime_fh, SWITCH_FALSE)) {
|
||||
flush_video_queue(source->video_q);
|
||||
}
|
||||
|
||||
@@ -479,7 +479,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
|
||||
retry:
|
||||
|
||||
source->has_video = switch_core_file_has_video(use_fh) || source->cover_art || source->banner_txt;
|
||||
source->has_video = switch_core_file_has_video(use_fh, SWITCH_TRUE) || source->cover_art || source->banner_txt;
|
||||
|
||||
is_open = switch_test_flag(use_fh, SWITCH_FILE_OPEN);
|
||||
|
||||
@@ -503,10 +503,10 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
if (is_open) {
|
||||
int svr = 0;
|
||||
|
||||
if (switch_core_has_video() && switch_core_file_has_video(use_fh)) {
|
||||
if (switch_core_has_video() && switch_core_file_has_video(use_fh, SWITCH_TRUE)) {
|
||||
switch_frame_t vid_frame = { 0 };
|
||||
|
||||
if (use_fh == &source->chime_fh && switch_core_file_has_video(&fh)) {
|
||||
if (use_fh == &source->chime_fh && switch_core_file_has_video(&fh, SWITCH_TRUE)) {
|
||||
if (switch_core_file_read_video(&fh, &vid_frame, svr) == SWITCH_STATUS_SUCCESS) {
|
||||
switch_img_free(&vid_frame.img);
|
||||
}
|
||||
@@ -599,14 +599,6 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
|
||||
switch_mutex_lock(cp->audio_mutex);
|
||||
|
||||
if (switch_test_flag(cp->handle, SWITCH_FILE_OPEN)) {
|
||||
if (source->has_video && !switch_test_flag(cp->handle, SWITCH_FILE_FLAG_VIDEO)) {
|
||||
switch_set_flag_locked(cp->handle, SWITCH_FILE_FLAG_VIDEO);
|
||||
} else {
|
||||
if (switch_test_flag(cp->handle, SWITCH_FILE_FLAG_VIDEO)) {
|
||||
switch_clear_flag_locked(cp->handle, SWITCH_FILE_FLAG_VIDEO);
|
||||
}
|
||||
}
|
||||
|
||||
if (switch_test_flag(cp->handle, SWITCH_FILE_CALLBACK)) {
|
||||
switch_mutex_unlock(cp->audio_mutex);
|
||||
continue;
|
||||
@@ -992,7 +984,7 @@ static switch_status_t local_stream_file_read_video(switch_file_handle_t *handle
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
while (switch_queue_size(context->video_q) < 5) {
|
||||
while (!(flags & SVR_BLOCK) && switch_queue_size(context->video_q) < 5) {
|
||||
return SWITCH_STATUS_BREAK;
|
||||
}
|
||||
|
||||
@@ -1094,6 +1086,16 @@ static switch_status_t local_stream_file_read(switch_file_handle_t *handle, void
|
||||
*len = 0;
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
if (context->source->has_video) {
|
||||
if (!switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO)) {
|
||||
switch_set_flag_locked(handle, SWITCH_FILE_FLAG_VIDEO);
|
||||
}
|
||||
} else {
|
||||
if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO)) {
|
||||
switch_clear_flag_locked(handle, SWITCH_FILE_FLAG_VIDEO);
|
||||
}
|
||||
}
|
||||
|
||||
switch_mutex_lock(context->audio_mutex);
|
||||
need = *len * 2 * context->source->channels;
|
||||
|
||||
Reference in new issue
Block a user