FS-7500: add video_decoded_echo var to make the echo app decode and re-encode video frames for testing

This commit is contained in:
Anthony Minessale 2014-11-19 14:47:26 -06:00 committed by Michael Jerris
parent 2d49b33002
commit ec9b7c0499
1 changed files with 5 additions and 8 deletions

View File

@ -637,7 +637,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
switch_status_t status; switch_status_t status;
switch_frame_t *read_frame; switch_frame_t *read_frame;
switch_channel_t *channel = switch_core_session_get_channel(session); switch_channel_t *channel = switch_core_session_get_channel(session);
int orig_vid = switch_channel_test_flag(channel, CF_VIDEO);
if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) { if (switch_channel_pre_answer(channel) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
@ -645,7 +644,9 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
arg_recursion_check_start(args); arg_recursion_check_start(args);
restart: if (switch_true(switch_channel_get_variable(channel, "video_decoded_echo"))) {
switch_channel_set_flag(channel, CF_VIDEO_DECODED_READ);
}
while (switch_channel_ready(channel)) { while (switch_channel_ready(channel)) {
status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0); status = switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
@ -653,12 +654,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
break; break;
} }
if (!orig_vid && switch_channel_test_flag(channel, CF_VIDEO)) {
orig_vid = 1;
goto restart;
}
switch_ivr_parse_all_events(session); switch_ivr_parse_all_events(session);
if (args && (args->input_callback || args->buf || args->buflen)) { if (args && (args->input_callback || args->buf || args->buflen)) {
@ -719,6 +714,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s
} }
} }
switch_core_session_video_reset(session);
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }