]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-8053 #resolve [When WebRTC's SDP contains a=sendonly for video, the client will...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 26 Aug 2015 17:10:34 +0000 (12:10 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 26 Aug 2015 17:10:34 +0000 (12:10 -0500)
src/mod/applications/mod_conference/conference_video.c
src/switch_core_media.c

index 08d2a91dc7c5f3cde01625543aac4fdf7450ba46..6e1c1d0d2faa0f191daefee2eed46b84a558c012 100644 (file)
@@ -1264,6 +1264,10 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
                                        continue;
                                }
 
+                               if (imember->video_flow == SWITCH_MEDIA_FLOW_RECVONLY) {
+                                       continue;
+                               }
+
                                if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) ||
                                        switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) {
                                        continue;
@@ -2588,6 +2592,10 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
                                        continue;
                                }
 
+                               if (imember->video_flow == SWITCH_MEDIA_FLOW_RECVONLY) {
+                                       continue;
+                               }
+
                                if (need_refresh) {
                                        switch_core_session_request_video_refresh(imember->session);
                                }
@@ -2922,6 +2930,10 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
                                continue;
                        }
 
+                       if (imember->video_flow == SWITCH_MEDIA_FLOW_RECVONLY) {
+                               continue;
+                       }
+
                        if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) ||
                                switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) {
                                continue;
index 9d7406d561c250c3e69bf7d1036d66fca41c0ce7..0d4cad757a4ef765f59c875068777086036793ba 100644 (file)
@@ -10440,6 +10440,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_encoded_video_frame(sw
        switch_io_event_hook_video_write_frame_t *ptr;
        switch_status_t status = SWITCH_STATUS_FALSE;
 
+       if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Writing video to RECVONLY session\n");
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (session->endpoint_interface->io_routines->write_video_frame) {
                if ((status = session->endpoint_interface->io_routines->write_video_frame(session, frame, flags, stream_id)) == SWITCH_STATUS_SUCCESS) {
                        for (ptr = session->event_hooks.video_write_frame; ptr; ptr = ptr->next) {
@@ -10506,6 +10511,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
                return SWITCH_STATUS_FALSE;
        }
 
+       if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
+               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Writing video to RECVONLY session\n");
+               return SWITCH_STATUS_SUCCESS;
+       }
+
        if (switch_channel_test_flag(session->channel, CF_VIDEO_PAUSE_WRITE)) {
                return SWITCH_STATUS_SUCCESS;
        }