]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7500: add video_decoded_echo var to make the echo app decode and re-encode video...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 19 Nov 2014 20:47:26 +0000 (14:47 -0600)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:46:45 +0000 (12:46 -0500)
src/switch_ivr_async.c

index 85dcc66ad512d0dc08ce8883dffa10bc5b91fcb0..9fa11c9f787008071a368f60f88fab1e73023212 100644 (file)
@@ -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;
 }