CF_VIDEO_DECODED_READ,
CF_VIDEO_DEBUG_READ,
CF_VIDEO_DEBUG_WRITE,
- CF_VIDEO_ONLY,
+ CF_NO_RECOVER,
CF_VIDEO_READY,
CF_VIDEO_MIRROR_INPUT,
CF_VIDEO_READ_FILE_ATTACHED,
switch_channel_set_flag(member->channel, CF_VIDEO_REFRESH_REQ);
switch_core_media_gen_key_frame(member->session);
- if (conference && conference->la && member->session && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {
+ if (conference && conference->la && member->session) {
cJSON *msg, *data;
const char *uuid = switch_core_session_get_uuid(member->session);
const char *cookie = switch_channel_get_variable(member->channel, "event_channel_cookie");
cJSON_AddItemToObject(video, "visible", cJSON_CreateFalse());
}
- cJSON_AddItemToObject(video, "videoOnly", cJSON_CreateBool(switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)));
+ cJSON_AddItemToObject(video, "noRecover", cJSON_CreateBool(switch_channel_test_flag(member->channel, CF_NO_RECOVER)));
if (switch_true(switch_channel_get_variable_dup(member->channel, "video_screen_share", SWITCH_FALSE, -1))) {
cJSON_AddItemToObject(video, "screenShare", cJSON_CreateTrue());
}
switch_core_session_set_video_read_callback(session, conference_video_thread_callback, (void *)&member);
switch_core_session_set_text_read_callback(session, conference_text_thread_callback, (void *)&member);
- if (switch_channel_test_flag(channel, CF_VIDEO_ONLY) || !switch_channel_test_flag(channel, CF_AUDIO)) {
- while(conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
- switch_frame_t *read_frame;
- if (switch_channel_test_flag(channel, CF_AUDIO)) {
- switch_core_session_read_frame(session, &read_frame, SWITCH_IO_FLAG_NONE, 0);
+ /* Run the conference loop */
+ do {
+ switch_media_flow_t audio_flow = switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_AUDIO);
+
+ if (switch_channel_test_flag(channel, CF_AUDIO) && (audio_flow == SWITCH_MEDIA_FLOW_SENDRECV || audio_flow == SWITCH_MEDIA_FLOW_RECVONLY)) {
+ conference_loop_output(&member);
+ } else {
+ if (conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
+ switch_yield(100000);
+ member.loop_loop = 1;
+ } else {
+ break;
}
- switch_yield(100000);
}
- } else {
-
- /* Run the conference loop */
- do {
- conference_loop_output(&member);
- } while (member.loop_loop);
- }
+ } while (member.loop_loop);
switch_core_session_video_reset(session);
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
continue;
}
- if (switch_channel_test_flag(tech_pvt->channel, CF_VIDEO_ONLY)) {
+ if (switch_channel_test_flag(tech_pvt->channel, CF_NO_RECOVER)) {
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_NORMAL_CLEARING);
continue;
}
const char *profile_name = NULL, *jsock_uuid_str = NULL;
switch_channel_t *channel = switch_core_session_get_channel(session);
- if (switch_channel_test_flag(channel, CF_VIDEO_ONLY)) {
+ if (switch_channel_test_flag(channel, CF_NO_RECOVER)) {
return 0;
}
static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock_t *jsock, cJSON **response)
{
- cJSON *obj = cJSON_CreateObject(), *screenShare = NULL, *dedEnc = NULL, *mirrorInput, *bandwidth = NULL, *canvas = NULL;
+ cJSON *obj = cJSON_CreateObject(), *vobj = NULL, *dedEnc = NULL, *mirrorInput, *bandwidth = NULL, *canvas = NULL;
switch_core_session_t *session = NULL;
switch_channel_t *channel;
switch_event_t *var_event;
err = 1; goto cleanup;
}
- if ((screenShare = cJSON_GetObjectItem(dialog, "screenShare")) && screenShare->type == cJSON_True) {
+ if ((vobj = cJSON_GetObjectItem(dialog, "screenShare")) && vobj->type == cJSON_True) {
switch_channel_set_variable(channel, "video_screen_share", "true");
- switch_channel_set_flag(channel, CF_VIDEO_ONLY);
+ }
+
+ if ((vobj = cJSON_GetObjectItem(dialog, "secondSource")) && vobj->type == cJSON_True) {
+ switch_channel_set_variable(channel, "video_second_source", "true");
+ }
+
+ if ((vobj = cJSON_GetObjectItem(dialog, "recoverCall")) && vobj->type == cJSON_False) {
+ switch_channel_set_flag(channel, CF_NO_RECOVER);
}
if ((dedEnc = cJSON_GetObjectItem(dialog, "dedEnc")) && dedEnc->type == cJSON_True) {
}
}
- if (switch_channel_test_flag(session->channel, CF_VIDEO_ONLY) && type == SWITCH_MEDIA_TYPE_AUDIO) {
- return SWITCH_STATUS_SUCCESS;
+ if (type == SWITCH_MEDIA_TYPE_AUDIO) {
+ switch_media_flow_t audio_flow = switch_core_session_media_flow(session, SWITCH_MEDIA_TYPE_AUDIO);
+
+ if (audio_flow != SWITCH_MEDIA_FLOW_SENDRECV && audio_flow != SWITCH_MEDIA_FLOW_SENDONLY) {
+ return SWITCH_STATUS_SUCCESS;
+ }
}
if (type != SWITCH_MEDIA_TYPE_TEXT) {