]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[core] add a flag to tell when video media bugs that touch the write stream are active
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 24 Jul 2019 15:28:04 +0000 (15:28 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:28 +0000 (22:00 +0300)
src/include/switch_types.h
src/switch_core_media_bug.c

index 2baddf0101a8e750323a4a538ed83776245e76a2..674de974d0de783cb8e1ccd8a37d7dff6466396b 100644 (file)
@@ -1630,6 +1630,8 @@ typedef enum {
        CF_WANT_DTLSv1_2,
        CF_RFC7329_COMPAT,
        CF_REATTACHED,
+       CF_VIDEO_READ_TAPPED,
+       CF_VIDEO_WRITE_TAPPED,
        /* WARNING: DO NOT ADD ANY FLAGS BELOW THIS LINE */
        /* IF YOU ADD NEW ONES CHECK IF THEY SHOULD PERSIST OR ZERO THEM IN switch_core_session.c switch_core_session_request_xml() */
        CF_FLAG_MAX
index 4e92c2d9e66819fb84540de9d6568c9adf1d8f43..eca4c495d2bd34342328edc825ea2ab1f1556685 100644 (file)
@@ -918,6 +918,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_add(switch_core_session_t
 
        if (switch_test_flag(bug, SMBF_READ_VIDEO_STREAM) || switch_test_flag(bug, SMBF_WRITE_VIDEO_STREAM) || switch_test_flag(bug, SMBF_READ_VIDEO_PING) || switch_test_flag(bug, SMBF_WRITE_VIDEO_PING)) {
                switch_channel_set_flag_recursive(session->channel, CF_VIDEO_DECODED_READ);
+
+               if (switch_test_flag(bug, SMBF_READ_VIDEO_STREAM) || switch_test_flag(bug, SMBF_READ_VIDEO_PING)) {
+                       switch_channel_set_flag_recursive(session->channel, CF_VIDEO_READ_TAPPED);
+               }
+
+               if (switch_test_flag(bug, SMBF_WRITE_VIDEO_STREAM) || switch_test_flag(bug, SMBF_WRITE_VIDEO_PING)) {
+                       switch_channel_set_flag_recursive(session->channel, CF_VIDEO_WRITE_TAPPED);
+               }
        }
 
        if (switch_test_flag(bug, SMBF_SPY_VIDEO_STREAM) || switch_core_media_bug_test_flag(bug, SMBF_SPY_VIDEO_STREAM_BLEG)) {
@@ -1297,6 +1305,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_close(switch_media_bug_t *
 
                if (switch_test_flag(bp, SMBF_READ_VIDEO_STREAM) || switch_test_flag(bp, SMBF_WRITE_VIDEO_STREAM) || switch_test_flag(bp, SMBF_READ_VIDEO_PING) || switch_test_flag(bp, SMBF_WRITE_VIDEO_PING)) {
                        switch_channel_clear_flag_recursive(bp->session->channel, CF_VIDEO_DECODED_READ);
+
+                       if (switch_test_flag(bp, SMBF_READ_VIDEO_STREAM) || switch_test_flag(bp, SMBF_READ_VIDEO_PING)) {
+                               switch_channel_clear_flag_recursive(bp->session->channel, CF_VIDEO_READ_TAPPED);
+                       }
+
+                       if (switch_test_flag(bp, SMBF_WRITE_VIDEO_STREAM) || switch_test_flag(bp, SMBF_WRITE_VIDEO_PING)) {
+                               switch_channel_clear_flag_recursive(bp->session->channel, CF_VIDEO_WRITE_TAPPED);
+                       }
                }
 
                bp->ready = 0;