[core, mod_verto] remove CF_VIDEO_ONLY and pay attention to the streams instead and add CF_NO_RECOVER flag for verto
This commit is contained in:
parent
55922ac6d0
commit
9457bf9082
|
@ -1595,7 +1595,7 @@ typedef enum {
|
|||
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,
|
||||
|
|
|
@ -634,7 +634,7 @@ void conference_event_adv_la(conference_obj_t *conference, conference_member_t *
|
|||
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");
|
||||
|
|
|
@ -186,7 +186,7 @@ void conference_member_update_status_field(conference_member_t *member)
|
|||
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());
|
||||
}
|
||||
|
|
|
@ -2474,21 +2474,21 @@ SWITCH_STANDARD_APP(conference_function)
|
|||
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);
|
||||
}
|
||||
switch_yield(100000);
|
||||
}
|
||||
} else {
|
||||
|
||||
/* Run the conference loop */
|
||||
do {
|
||||
/* 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);
|
||||
} while (member.loop_loop);
|
||||
}
|
||||
} else {
|
||||
if (conference_utils_member_test_flag((&member), MFLAG_RUNNING) && switch_channel_ready(channel)) {
|
||||
switch_yield(100000);
|
||||
member.loop_loop = 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} while (member.loop_loop);
|
||||
|
||||
switch_core_session_video_reset(session);
|
||||
switch_channel_clear_flag_recursive(channel, CF_VIDEO_DECODED_READ);
|
||||
|
|
|
@ -1347,7 +1347,7 @@ static void detach_calls(jsock_t *jsock)
|
|||
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;
|
||||
}
|
||||
|
@ -2762,7 +2762,7 @@ static int verto_recover_callback(switch_core_session_t *session)
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -3817,7 +3817,7 @@ static switch_bool_t verto__info_func(const char *method, cJSON *params, jsock_t
|
|||
|
||||
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;
|
||||
|
@ -3899,9 +3899,16 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
|
|||
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) {
|
||||
|
|
|
@ -3459,8 +3459,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_write_frame(switch_core_sessio
|
|||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue