From ec9b7c049975e889d0a15220bc2f6c880dc245f4 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 19 Nov 2014 14:47:26 -0600 Subject: [PATCH] FS-7500: add video_decoded_echo var to make the echo app decode and re-encode video frames for testing --- src/switch_ivr_async.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index 85dcc66ad5..9fa11c9f78 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -637,7 +637,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_session_echo(switch_core_session_t *s switch_status_t status; switch_frame_t *read_frame; 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) { 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); - 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)) { 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; } - if (!orig_vid && switch_channel_test_flag(channel, CF_VIDEO)) { - orig_vid = 1; - goto restart; - } - - switch_ivr_parse_all_events(session); 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; }