]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7502: video eavesdrop
authorSeven Du <dujinfang@gmail.com>
Wed, 29 Aug 2012 04:59:21 +0000 (12:59 +0800)
committerMichael Jerris <mike@jerris.com>
Thu, 28 May 2015 17:46:41 +0000 (12:46 -0500)
src/switch_ivr_async.c

index a8244076a8d2994ada8c17fa095ab45560fec470..e2705f361450b2581d8fb67e1eac0929f7f76b61 100644 (file)
@@ -1651,7 +1651,17 @@ static switch_bool_t eavesdrop_callback(switch_media_bug_t *bug, void *user_data
                        }
                }
                break;
+       case SWITCH_ABC_TYPE_READ_VIDEO_PING:
+               if (!bug->ping_frame) break;
 
+               if (ep->eavesdropper && switch_core_session_read_lock(ep->eavesdropper) == SWITCH_STATUS_SUCCESS) {
+                       switch_channel_t *channel = switch_core_session_get_channel(ep->eavesdropper);
+                       if (switch_channel_test_flag(channel, CF_VIDEO)) {
+                               switch_core_session_write_video_frame(ep->eavesdropper, bug->ping_frame, SWITCH_IO_FLAG_NONE, 0);
+                       }
+                       switch_core_session_rwunlock(ep->eavesdropper);
+               }
+               break;
        default:
                break;
        }