FS-8053 #resolve [When WebRTC's SDP contains a=sendonly for video, the client will still receive the video stream]

This commit is contained in:
Anthony Minessale 2015-08-26 12:10:34 -05:00
parent 0777568241
commit de3b0a0957
2 changed files with 22 additions and 0 deletions

View 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;

View 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;
}