FS-9221 Add inactive support
This commit is contained in:
parent
4f2c4124d1
commit
bf34d03469
|
@ -926,7 +926,7 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member,
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY && !member->avatar_png_img) {
|
if ((switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) && !member->avatar_png_img) {
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1317,7 +1317,7 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
|
||||||
switch_core_session_request_video_refresh(imember->session);
|
switch_core_session_request_video_refresh(imember->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
|
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
switch_core_session_rwunlock(imember->session);
|
switch_core_session_rwunlock(imember->session);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -1643,7 +1643,10 @@ void conference_video_check_avatar(conference_member_t *member, switch_bool_t fo
|
||||||
canvas = conference_video_get_canvas_locked(member);
|
canvas = conference_video_get_canvas_locked(member);
|
||||||
|
|
||||||
if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) &&
|
if (conference_utils_test_flag(member->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) &&
|
||||||
(!switch_channel_test_flag(member->channel, CF_VIDEO_READY) || switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY)) {
|
(!switch_channel_test_flag(member->channel, CF_VIDEO_READY) ||
|
||||||
|
(switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY ||
|
||||||
|
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE))) {
|
||||||
|
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
conference_video_release_canvas(&canvas);
|
conference_video_release_canvas(&canvas);
|
||||||
}
|
}
|
||||||
|
@ -1656,7 +1659,8 @@ void conference_video_check_avatar(conference_member_t *member, switch_bool_t fo
|
||||||
|
|
||||||
member->avatar_patched = 0;
|
member->avatar_patched = 0;
|
||||||
|
|
||||||
if (!force && switch_channel_test_flag(member->channel, CF_VIDEO_READY) && switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
|
if (!force && switch_channel_test_flag(member->channel, CF_VIDEO_READY) &&
|
||||||
|
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY && switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
conference_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO);
|
conference_utils_member_set_flag_locked(member, MFLAG_ACK_VIDEO);
|
||||||
} else {
|
} else {
|
||||||
if (member->conference->no_video_avatar) {
|
if (member->conference->no_video_avatar) {
|
||||||
|
@ -1795,7 +1799,8 @@ switch_status_t conference_video_find_layer(conference_obj_t *conference, mcu_ca
|
||||||
if (!layer &&
|
if (!layer &&
|
||||||
(canvas->layers_used < canvas->total_layers ||
|
(canvas->layers_used < canvas->total_layers ||
|
||||||
(avatar_layers && !member->avatar_png_img) || conference_utils_member_test_flag(member, MFLAG_MOD)) &&
|
(avatar_layers && !member->avatar_png_img) || conference_utils_member_test_flag(member, MFLAG_MOD)) &&
|
||||||
(member->avatar_png_img || switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY)) {
|
(member->avatar_png_img || (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
|
||||||
|
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE))) {
|
||||||
/* find an empty layer */
|
/* find an empty layer */
|
||||||
for (i = 0; i < canvas->total_layers; i++) {
|
for (i = 0; i < canvas->total_layers; i++) {
|
||||||
mcu_layer_t *xlayer = &canvas->layers[i];
|
mcu_layer_t *xlayer = &canvas->layers[i];
|
||||||
|
@ -1868,7 +1873,11 @@ void conference_video_pop_next_image(conference_member_t *member, switch_image_t
|
||||||
size = switch_queue_size(member->video_queue);
|
size = switch_queue_size(member->video_queue);
|
||||||
} while(size > 0);
|
} while(size > 0);
|
||||||
|
|
||||||
if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) && member->video_layer_id > -1 && switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
|
if (conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN) &&
|
||||||
|
member->video_layer_id > -1 &&
|
||||||
|
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
|
||||||
|
switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE
|
||||||
|
) {
|
||||||
if (img) {
|
if (img) {
|
||||||
member->good_img++;
|
member->good_img++;
|
||||||
if ((member->good_img % (int)(member->conference->video_fps.fps * 10)) == 0) {
|
if ((member->good_img % (int)(member->conference->video_fps.fps * 10)) == 0) {
|
||||||
|
@ -2227,7 +2236,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
|
if (imember->channel && switch_channel_ready(imember->channel) && switch_channel_test_flag(imember->channel, CF_VIDEO_READY) &&
|
||||||
!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
|
!conference_utils_member_test_flag(imember, MFLAG_SECOND_SCREEN) &&
|
||||||
conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || (no_av && !imember->avatar_png_img))
|
conference_utils_member_test_flag(imember, MFLAG_RUNNING) && (!no_muted || seen) && (!no_av || (no_av && !imember->avatar_png_img))
|
||||||
&& imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY) {
|
&& imember->canvas_id == canvas->canvas_id && imember->video_media_flow != SWITCH_MEDIA_FLOW_SENDONLY && imember->video_media_flow != SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
video_count++;
|
video_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2470,7 +2479,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
switch_img_free(&img);
|
switch_img_free(&img);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!layer && (!conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) || ((switch_channel_test_flag(imember->channel, CF_VIDEO_READY) && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY)))) {
|
if (!layer && (!conference_utils_test_flag(imember->conference, CFLAG_VIDEO_REQUIRED_FOR_CANVAS) || ((switch_channel_test_flag(imember->channel, CF_VIDEO_READY) && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE)))) {
|
||||||
if (conference_video_find_layer(conference, canvas, imember, &layer) == SWITCH_STATUS_SUCCESS) {
|
if (conference_video_find_layer(conference, canvas, imember, &layer) == SWITCH_STATUS_SUCCESS) {
|
||||||
imember->layer_timeout = 0;
|
imember->layer_timeout = 0;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2492,7 +2501,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
// switch_img_free(&layer->cur_img);
|
// switch_img_free(&layer->cur_img);
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS)) {
|
if (conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN) || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE || conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS)) {
|
||||||
layer->mute_patched = 0;
|
layer->mute_patched = 0;
|
||||||
} else {
|
} else {
|
||||||
switch_image_t *tmp;
|
switch_image_t *tmp;
|
||||||
|
@ -2613,7 +2622,9 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
if (total > 0 &&
|
if (total > 0 &&
|
||||||
(!conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) ||
|
(!conference_utils_test_flag(imember->conference, CFLAG_VIDEO_MUTE_EXIT_CANVAS) ||
|
||||||
conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) &&
|
conference_utils_member_test_flag(imember, MFLAG_CAN_BE_SEEN)) &&
|
||||||
imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
|
imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY &&
|
||||||
|
imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
|
|
||||||
total--;
|
total--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2637,7 +2648,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY) {
|
if (imember->session && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_SENDONLY && switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) != SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
conference_video_pop_next_image(imember, &imember->pcanvas_img);
|
conference_video_pop_next_image(imember, &imember->pcanvas_img);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2683,7 +2694,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
|
|
||||||
if (!imember->rec &&
|
if (!imember->rec &&
|
||||||
(!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) || !imember->canvas ||
|
(!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) || !imember->canvas ||
|
||||||
(switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) ||
|
(switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY ||
|
||||||
|
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) ||
|
||||||
(switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS))) {
|
(switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2717,7 +2729,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
switch_image_t *use_img = NULL;
|
switch_image_t *use_img = NULL;
|
||||||
|
|
||||||
if (!omember->session || !switch_channel_test_flag(omember->channel, CF_VIDEO_READY) ||
|
if (!omember->session || !switch_channel_test_flag(omember->channel, CF_VIDEO_READY) ||
|
||||||
switch_core_session_media_flow(omember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
|
switch_core_session_media_flow(omember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(omember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3016,7 +3028,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
|
||||||
switch_core_session_request_video_refresh(imember->session);
|
switch_core_session_request_video_refresh(imember->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
|
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
switch_core_session_rwunlock(imember->session);
|
switch_core_session_rwunlock(imember->session);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3365,7 +3377,7 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
|
||||||
switch_core_session_request_video_refresh(imember->session);
|
switch_core_session_request_video_refresh(imember->session);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
|
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
switch_core_session_rwunlock(imember->session);
|
switch_core_session_rwunlock(imember->session);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -3450,7 +3462,7 @@ void conference_video_find_floor(conference_member_t *member, switch_bool_t ente
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY && !imember->avatar_png_img) {
|
if ((switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) && !imember->avatar_png_img) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3515,7 +3527,7 @@ void conference_video_set_floor_holder(conference_obj_t *conference, conference_
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (member && switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY && !member->avatar_png_img) {
|
if (member && (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) && !member->avatar_png_img) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3740,7 +3752,7 @@ switch_status_t conference_video_thread_callback(switch_core_session_t *session,
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
|
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY || switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3780,7 +3780,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
sdp_media_t *m;
|
sdp_media_t *m;
|
||||||
sdp_attribute_t *attr;
|
sdp_attribute_t *attr;
|
||||||
int ptime = 0, dptime = 0, maxptime = 0, dmaxptime = 0;
|
int ptime = 0, dptime = 0, maxptime = 0, dmaxptime = 0;
|
||||||
int sendonly = 0, recvonly = 0;
|
int sendonly = 0, recvonly = 0, inactive = 0;
|
||||||
int greedy = 0, x = 0, skip = 0;
|
int greedy = 0, x = 0, skip = 0;
|
||||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||||
const char *val;
|
const char *val;
|
||||||
|
@ -4093,6 +4093,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
switch_channel_set_variable(smh->session->channel, "audio_media_flow", "recvonly");
|
switch_channel_set_variable(smh->session->channel, "audio_media_flow", "recvonly");
|
||||||
a_engine->smode = SWITCH_MEDIA_FLOW_RECVONLY;
|
a_engine->smode = SWITCH_MEDIA_FLOW_RECVONLY;
|
||||||
break;
|
break;
|
||||||
|
case SWITCH_MEDIA_FLOW_INACTIVE:
|
||||||
|
switch_channel_set_variable(smh->session->channel, "audio_media_flow", "inactive");
|
||||||
|
a_engine->smode = SWITCH_MEDIA_FLOW_INACTIVE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
switch_channel_set_variable(smh->session->channel, "audio_media_flow", "sendrecv");
|
switch_channel_set_variable(smh->session->channel, "audio_media_flow", "sendrecv");
|
||||||
a_engine->smode = SWITCH_MEDIA_FLOW_SENDRECV;
|
a_engine->smode = SWITCH_MEDIA_FLOW_SENDRECV;
|
||||||
|
@ -4112,7 +4116,6 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
sendonly = 1;
|
sendonly = 1;
|
||||||
switch_channel_set_variable(session->channel, "media_audio_mode", "recvonly");
|
switch_channel_set_variable(session->channel, "media_audio_mode", "recvonly");
|
||||||
} else if (sendonly < 2 && !strcasecmp(attr->a_name, "inactive")) {
|
} else if (sendonly < 2 && !strcasecmp(attr->a_name, "inactive")) {
|
||||||
sendonly = 1;
|
|
||||||
switch_channel_set_variable(session->channel, "media_audio_mode", "inactive");
|
switch_channel_set_variable(session->channel, "media_audio_mode", "inactive");
|
||||||
} else if (!strcasecmp(attr->a_name, "recvonly")) {
|
} else if (!strcasecmp(attr->a_name, "recvonly")) {
|
||||||
switch_channel_set_variable(session->channel, "media_audio_mode", "sendonly");
|
switch_channel_set_variable(session->channel, "media_audio_mode", "sendonly");
|
||||||
|
@ -4140,7 +4143,7 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (sendonly != 1 && recvonly != 1) {
|
if (sendonly != 1 && recvonly != 1 && inactive != 1) {
|
||||||
switch_channel_set_variable(session->channel, "media_audio_mode", NULL);
|
switch_channel_set_variable(session->channel, "media_audio_mode", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4149,6 +4152,8 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
a_engine->smode = sdp_media_flow(sdp_sendonly);
|
a_engine->smode = sdp_media_flow(sdp_sendonly);
|
||||||
} else if (recvonly) {
|
} else if (recvonly) {
|
||||||
a_engine->smode = sdp_media_flow(sdp_recvonly);
|
a_engine->smode = sdp_media_flow(sdp_recvonly);
|
||||||
|
} else if (inactive) {
|
||||||
|
a_engine->smode = sdp_media_flow(sdp_inactive);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4759,6 +4764,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
switch_channel_set_variable(smh->session->channel, "video_media_flow", "recvonly");
|
switch_channel_set_variable(smh->session->channel, "video_media_flow", "recvonly");
|
||||||
v_engine->smode = SWITCH_MEDIA_FLOW_RECVONLY;
|
v_engine->smode = SWITCH_MEDIA_FLOW_RECVONLY;
|
||||||
break;
|
break;
|
||||||
|
case SWITCH_MEDIA_FLOW_INACTIVE:
|
||||||
|
switch_channel_set_variable(smh->session->channel, "video_media_flow", "inactive");
|
||||||
|
v_engine->smode = SWITCH_MEDIA_FLOW_INACTIVE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
switch_channel_set_variable(smh->session->channel, "video_media_flow", "sendrecv");
|
switch_channel_set_variable(smh->session->channel, "video_media_flow", "sendrecv");
|
||||||
v_engine->smode = SWITCH_MEDIA_FLOW_SENDRECV;
|
v_engine->smode = SWITCH_MEDIA_FLOW_SENDRECV;
|
||||||
|
@ -7940,12 +7949,14 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||||
sr = "sendonly";
|
sr = "sendonly";
|
||||||
} else if (a_engine->smode == SWITCH_MEDIA_FLOW_RECVONLY) {
|
} else if (a_engine->smode == SWITCH_MEDIA_FLOW_RECVONLY) {
|
||||||
sr = "recvonly";
|
sr = "recvonly";
|
||||||
|
} else if (a_engine->smode == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
|
sr = "inactive";
|
||||||
} else {
|
} else {
|
||||||
sr = "sendrecv";
|
sr = "sendrecv";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((var_val = switch_channel_get_variable(session->channel, "origination_audio_mode"))) {
|
if ((var_val = switch_channel_get_variable(session->channel, "origination_audio_mode"))) {
|
||||||
if (!strcasecmp(sr, "sendonly") || !strcasecmp(sr, "recvonly") || !strcasecmp(sr, "sendrecv")) {
|
if (!strcasecmp(sr, "sendonly") || !strcasecmp(sr, "recvonly") || !strcasecmp(sr, "sendrecv") || !strcasecmp(sr, "inactive")) {
|
||||||
sr = var_val;
|
sr = var_val;
|
||||||
}
|
}
|
||||||
switch_channel_set_variable(session->channel, "origination_audio_mode", NULL);
|
switch_channel_set_variable(session->channel, "origination_audio_mode", NULL);
|
||||||
|
@ -8452,6 +8463,8 @@ SWITCH_DECLARE(void) switch_core_media_gen_local_sdp(switch_core_session_t *sess
|
||||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "%s", "a=sendonly\r\n");
|
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "%s", "a=sendonly\r\n");
|
||||||
} else if (v_engine->smode == SWITCH_MEDIA_FLOW_RECVONLY) {
|
} else if (v_engine->smode == SWITCH_MEDIA_FLOW_RECVONLY) {
|
||||||
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "%s", "a=recvonly\r\n");
|
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "%s", "a=recvonly\r\n");
|
||||||
|
} else if (v_engine->smode == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
|
switch_snprintf(buf + strlen(buf), SDPBUFLEN - strlen(buf), "%s", "a=inactive\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (smh->mparams->num_codecs) {
|
} else if (smh->mparams->num_codecs) {
|
||||||
|
@ -11222,8 +11235,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_encoded_video_frame(sw
|
||||||
switch_io_event_hook_video_write_frame_t *ptr;
|
switch_io_event_hook_video_write_frame_t *ptr;
|
||||||
switch_status_t status = SWITCH_STATUS_FALSE;
|
switch_status_t status = SWITCH_STATUS_FALSE;
|
||||||
|
|
||||||
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
|
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3, "Writing video to RECVONLY session\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3, "Writing video to RECVONLY/INACTIVE session\n");
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11293,8 +11306,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_video_frame(switch_cor
|
||||||
return SWITCH_STATUS_FALSE;
|
return SWITCH_STATUS_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
|
if (switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY || switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_INACTIVE) {
|
||||||
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3, "Writing video to RECVONLY session\n");
|
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG3, "Writing video to RECVONLY/INACTIVE session\n");
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue