FS-10131: [freeswitch-core] Incorrect video decode flags in some places #resolve

This commit is contained in:
Anthony Minessale 2017-03-13 14:50:28 -05:00
parent 1c51205a72
commit 3878d91316
6 changed files with 24 additions and 10 deletions

View File

@ -844,7 +844,7 @@ SWITCH_STANDARD_APP(record_av_function)
goto done; goto done;
} }
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
switch_core_media_get_vid_params(session, &vid_params); switch_core_media_get_vid_params(session, &vid_params);
switch_channel_set_flag(channel, CF_VIDEO_ECHO); switch_channel_set_flag(channel, CF_VIDEO_ECHO);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "video size: %dx%d\n", vid_params.width, vid_params.height); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "video size: %dx%d\n", vid_params.width, vid_params.height);
@ -1120,6 +1120,8 @@ SWITCH_STANDARD_APP(record_av_function)
end: end:
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
if (fc) { if (fc) {
if (has_video) close_stream(fc, &video_st); if (has_video) close_stream(fc, &video_st);
if (has_audio) close_stream(fc, &audio_st); if (has_audio) close_stream(fc, &audio_st);

View File

@ -2208,7 +2208,7 @@ SWITCH_STANDARD_APP(conference_function)
switch_core_session_receive_message(session, &msg); switch_core_session_receive_message(session, &msg);
if (conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) { if (conference_utils_test_flag(conference, CFLAG_TRANSCODE_VIDEO)) {
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
switch_core_media_gen_key_frame(session); switch_core_media_gen_key_frame(session);
} }
@ -2227,6 +2227,9 @@ SWITCH_STANDARD_APP(conference_function)
} while (member.loop_loop); } while (member.loop_loop);
} }
switch_core_session_video_reset(session);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
switch_core_session_set_video_read_callback(session, NULL, NULL); switch_core_session_set_video_read_callback(session, NULL, NULL);
switch_channel_set_private(channel, "_conference_autocall_list_", NULL); switch_channel_set_private(channel, "_conference_autocall_list_", NULL);

View File

@ -1115,6 +1115,9 @@ SWITCH_STANDARD_APP(cv_start_function)
switch_core_session_set_video_read_callback(session, NULL, NULL); switch_core_session_set_video_read_callback(session, NULL, NULL);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_ECHO);
uninit_context(&context); uninit_context(&context);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);
@ -1133,13 +1136,11 @@ static switch_bool_t cv_bug_callback(switch_media_bug_t *bug, void *user_data, s
switch (type) { switch (type) {
case SWITCH_ABC_TYPE_INIT: case SWITCH_ABC_TYPE_INIT:
{ {
switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
} }
break; break;
case SWITCH_ABC_TYPE_CLOSE: case SWITCH_ABC_TYPE_CLOSE:
{ {
switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock); switch_thread_rwlock_unlock(MODULE_INTERFACE->rwlock);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
uninit_context(context); uninit_context(context);
} }
break; break;

View File

@ -749,7 +749,7 @@ SWITCH_STANDARD_APP(decode_video_function)
switch_channel_answer(channel); switch_channel_answer(channel);
switch_core_session_request_video_refresh(session); switch_core_session_request_video_refresh(session);
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
switch_core_media_start_video_function(session, decode_video_thread, &max_pictures); switch_core_media_start_video_function(session, decode_video_thread, &max_pictures);
@ -764,6 +764,9 @@ SWITCH_STANDARD_APP(decode_video_function)
switch_core_media_end_video_function(session); switch_core_media_end_video_function(session);
switch_core_session_video_reset(session); switch_core_session_video_reset(session);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
} }

View File

@ -1513,7 +1513,7 @@ SWITCH_STANDARD_APP(play_video_function)
libvlc_video_set_format_callbacks(context->mp, video_format_setup_callback, video_format_clean_callback); libvlc_video_set_format_callbacks(context->mp, video_format_setup_callback, video_format_clean_callback);
libvlc_video_set_callbacks(context->mp, vlc_video_lock_callback, vlc_video_unlock_callback, vlc_video_display_callback, context); libvlc_video_set_callbacks(context->mp, vlc_video_lock_callback, vlc_video_unlock_callback, vlc_video_display_callback, context);
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
top: top:
@ -1612,6 +1612,7 @@ end:
} }
switch_core_session_video_reset(session); switch_core_session_video_reset(session);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
if (vlc_handle) libvlc_release(vlc_handle); if (vlc_handle) libvlc_release(vlc_handle);
} }

View File

@ -653,12 +653,12 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
} }
arg_recursion_check_start(args); arg_recursion_check_start(args);
if (switch_true(switch_channel_get_variable(channel, "echo_decode_video"))) { if (switch_channel_var_true(channel, "echo_decode_video")) {
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ); switch_channel_set_flag_recursive(channel, CF_VIDEO_DECODED_READ);
} }
if (switch_true(switch_channel_get_variable(channel, "echo_decode_audio"))) { if (switch_channel_var_true(channel, "echo_decode_audio")) {
switch_core_session_raw_read(session); switch_core_session_raw_read(session);
} }
@ -715,6 +715,10 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
} }
} }
if (switch_channel_var_true(channel, "echo_decode_video")) {
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
}
switch_core_session_video_reset(session); switch_core_session_video_reset(session);
switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE); switch_core_session_reset(session, SWITCH_TRUE, SWITCH_TRUE);