FS-8545 #resolve [Improve controls for screen share]

This commit is contained in:
Anthony Minessale 2015-11-16 15:54:43 -06:00
parent 67491b102c
commit 9f1c89b8e3
8 changed files with 72 additions and 34 deletions

View File

@ -223,7 +223,7 @@ textarea {
body {
margin: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: verdana, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 20px;
color: #333333;
@ -1065,7 +1065,7 @@ input,
button,
select,
textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: verdana, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
label {
@ -4510,7 +4510,7 @@ input[type="submit"].btn.btn-mini {
.navbar-search .search-query {
padding: 4px 14px;
margin-bottom: 0;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-family: verdana, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: normal;
line-height: 1;
@ -5624,7 +5624,6 @@ a.thumbnail:focus {
display: inline-block;
padding: 2px 4px;
font-size: 11.844px;
font-weight: bold;
line-height: 14px;
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);

View File

@ -918,7 +918,6 @@ body .modal-body .btn-group .btn.active {
.members-badges {
font-size: 10px;
text-transform: uppercase;
margin-top: -2px;
}

View File

@ -28,7 +28,8 @@
<div class="members-badges">
<div ng-if="member.status.video.floor" class="label badge-floor" ng-class="{'label-danger': member.status.video.floorLocked, 'label-info': !member.status.video.floorLocked}"><i class="mdi mdi-action-https lock-floor" ng-if="member.status.video.floorLocked"></i> <span>Floor</span></div>
<div ng-if="member.status.video.reservationID == 'presenter'" class="label label-warning">Presenter</div>
<div ng-if="member.status.video.reservationID == 'presenter'" class="label label-info">Presenter</div>
<div ng-if="member.status.video.screenShare" class="label label-info">Screen Share</div>
</div>
</h4>

View File

@ -471,9 +471,11 @@ vertoService.service('verto', ['$rootScope', '$cookieStore', '$location', 'stora
if (params.pvtData) {
switch (params.pvtData.action) {
case "conference-liveArray-join":
console.log("conference-liveArray-join");
stopConference();
startConference(v, dialog, params.pvtData);
if (!params.pvtData.secondScreen && !params.pvtData.screenShare && !params.pvtData.videoOnly) {
console.log("conference-liveArray-join");
stopConference();
startConference(v, dialog, params.pvtData);
}
break;
case "conference-liveArray-part":
console.log("conference-liveArray-part");

View File

@ -378,13 +378,10 @@ void conference_event_la_command_handler(switch_live_array_t *la, const char *cm
void conference_event_adv_la(conference_obj_t *conference, conference_member_t *member, switch_bool_t join)
{
//if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY) {
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");
@ -412,6 +409,14 @@ void conference_event_adv_la(conference_obj_t *conference, conference_member_t *
cJSON_AddItemToObject(data, "secondScreen", cJSON_CreateTrue());
}
if (switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {
cJSON_AddItemToObject(data, "videoOnly", cJSON_CreateTrue());
}
if (switch_true(switch_channel_get_variable_dup(member->channel, "video_screen_share", SWITCH_FALSE, -1))) {
cJSON_AddItemToObject(data, "screenShare", cJSON_CreateTrue());
}
if (conference_utils_member_test_flag(member, MFLAG_MOD)) {
cJSON_AddItemToObject(data, "modChannel", cJSON_CreateString(conference->mod_event_channel));
}

View File

@ -150,8 +150,7 @@ void conference_member_update_status_field(conference_member_t *member)
char *str, *vstr = "", display[128] = "", *json_display = NULL;
cJSON *json, *audio, *video;
if (!member->conference->la || !member->json ||
!member->status_field || switch_channel_test_flag(member->channel, CF_VIDEO_ONLY) || conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
if (!member->conference->la || !member->json || !member->status_field || conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
return;
}
@ -169,6 +168,19 @@ void conference_member_update_status_field(conference_member_t *member)
if (switch_channel_test_flag(member->channel, CF_VIDEO) || member->avatar_png_img) {
video = cJSON_CreateObject();
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) {
cJSON_AddItemToObject(video, "visible", cJSON_CreateTrue());
} else {
cJSON_AddItemToObject(video, "visible", cJSON_CreateFalse());
}
cJSON_AddItemToObject(video, "videoOnly", cJSON_CreateBool(switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)));
if (switch_true(switch_channel_get_variable_dup(member->channel, "video_screen_share", SWITCH_FALSE, -1))) {
cJSON_AddItemToObject(video, "screenShare", cJSON_CreateTrue());
}
cJSON_AddItemToObject(video, "avatarPresented", cJSON_CreateBool(!!member->avatar_png_img));
cJSON_AddItemToObject(video, "mediaFlow", cJSON_CreateString(switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY ? "sendOnly" : "sendRecv"));
cJSON_AddItemToObject(video, "muted", cJSON_CreateBool(!conference_utils_member_test_flag(member, MFLAG_CAN_BE_SEEN)));
@ -914,7 +926,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
switch_mutex_unlock(member->audio_out_mutex);
switch_mutex_unlock(member->audio_in_mutex);
if (conference->la && member->channel && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {
if (conference->la && member->channel) {
if (!conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
cJSON *dvars;
switch_event_t *var_event;
@ -929,7 +941,6 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
switch_channel_get_variable(member->channel, "original_read_codec"),
switch_channel_get_variable(member->channel, "original_read_rate")
));
member->status_field = cJSON_CreateString("");
cJSON_AddItemToArray(member->json, member->status_field);
@ -964,6 +975,7 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
if (!conference_utils_member_test_flag(member, MFLAG_SECOND_SCREEN)) {
switch_live_array_add(conference->la, switch_core_session_get_uuid(member->session), -1, &member->json, SWITCH_FALSE);
}
}
@ -1224,7 +1236,7 @@ switch_status_t conference_member_del(conference_obj_t *conference, conference_m
switch_mutex_unlock(member->audio_in_mutex);
if (conference->la && member->session && !switch_channel_test_flag(member->channel, CF_VIDEO_ONLY)) {
if (conference->la && member->session) {
switch_live_array_del(conference->la, switch_core_session_get_uuid(member->session));
//switch_live_array_clear_alias(conference->la, switch_core_session_get_uuid(member->session), "conference");
conference_event_adv_la(conference, member, SWITCH_FALSE);

View File

@ -617,11 +617,9 @@ void conference_video_detach_video_layer(conference_member_t *member)
mcu_layer_t *layer = NULL;
mcu_canvas_t *canvas = NULL;
if (member->canvas_id < 0) return;
if (member->canvas_id < 0 || member->video_layer_id < 0) return;
canvas = conference_video_get_canvas_locked(member);
if (!canvas || member->video_layer_id < 0) {
if (!(canvas = conference_video_get_canvas_locked(member))) {
return;
}
@ -894,10 +892,12 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member,
if (!switch_channel_test_flag(channel, CF_VIDEO) && !member->avatar_png_img) {
printf("WTF %d\n", __LINE__);
return SWITCH_STATUS_FALSE;
}
if (switch_core_session_media_flow(member->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_SENDONLY && !member->avatar_png_img) {
printf("WTF %d\n", __LINE__);
return SWITCH_STATUS_FALSE;
}
@ -908,26 +908,31 @@ switch_status_t conference_video_attach_video_layer(conference_member_t *member,
layer->tagged = 0;
if (layer->fnode || layer->geometry.fileonly) {
printf("WTF %d\n", __LINE__);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
if (layer->geometry.flooronly && member->id != member->conference->video_floor_holder) {
printf("WTF %d\n", __LINE__);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
if (layer->geometry.res_id) {
if (!member->video_reservation_id || strcmp(layer->geometry.res_id, member->video_reservation_id)) {
printf("WTF %d\n", __LINE__);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
}
if (layer->member_id && layer->member_id == (int)member->id) {
member->video_layer_id = idx;
printf("WTF %d\n", __LINE__);
switch_goto_status(SWITCH_STATUS_BREAK, end);
}
if (layer->geometry.res_id || member->video_reservation_id) {
if (!layer->geometry.res_id || !member->video_reservation_id || strcmp(layer->geometry.res_id, member->video_reservation_id)) {
printf("WTF %d\n", __LINE__);
switch_goto_status(SWITCH_STATUS_FALSE, end);
}
}
@ -1267,7 +1272,6 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
}
if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) ||
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY ||
switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) {
continue;
}
@ -1276,6 +1280,10 @@ void conference_video_write_canvas_image_to_codec_group(conference_obj_t *confer
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
continue;
}
//switch_core_session_write_encoded_video_frame(imember->session, frame, 0, 0);
switch_set_flag(frame, SFF_ENCODED);
@ -2184,7 +2192,7 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
}
//VIDFLOOR
if (conference->canvas_count == 1 && canvas->layout_floor_id > -1 && imember->id == conference->video_floor_holder &&
if (canvas->layout_floor_id > -1 && imember->id == conference->video_floor_holder &&
imember->video_layer_id != canvas->layout_floor_id) {
conference_video_attach_video_layer(imember, canvas, canvas->layout_floor_id);
}
@ -2681,7 +2689,6 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
}
if (!imember->session || !switch_channel_test_flag(imember->channel, CF_VIDEO) ||
switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY ||
switch_core_session_read_lock(imember->session) != SWITCH_STATUS_SUCCESS) {
continue;
}
@ -2690,6 +2697,11 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
continue;
}
if (send_keyframe) {
switch_core_media_gen_key_frame(imember->session);
}
@ -3024,9 +3036,6 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
continue;
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == 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) {
@ -3037,6 +3046,10 @@ void *SWITCH_THREAD_FUNC conference_video_super_muxing_thread_run(switch_thread_
switch_core_session_request_video_refresh(imember->session);
}
if (switch_core_session_media_flow(imember->session, SWITCH_MEDIA_TYPE_VIDEO) == SWITCH_MEDIA_FLOW_RECVONLY) {
continue;
}
if (send_keyframe) {
switch_core_media_gen_key_frame(imember->session);
}
@ -3213,11 +3226,17 @@ void conference_video_set_floor_holder(conference_obj_t *conference, conference_
}
//VIDFLOOR
if (conference->canvas_count == 1 && member && conference->canvases[0] && conference->canvases[0]->layout_floor_id > -1) {
conference_video_attach_video_layer(member, conference->canvases[0], conference->canvases[0]->layout_floor_id);
}
if (member) {
mcu_canvas_t *canvas = NULL;
if ((canvas = conference_video_get_canvas_locked(member))) {
if (canvas->layout_floor_id > -1) {
printf("WTF ATTACH???\n");
conference_video_attach_video_layer(member, canvas, canvas->layout_floor_id);
}
conference_video_release_canvas(&canvas);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Adding video floor %s\n",
switch_channel_get_name(member->channel));

View File

@ -3405,6 +3405,7 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
}
if ((screenShare = cJSON_GetObjectItem(dialog, "screenShare")) && screenShare->type == cJSON_True) {
switch_channel_set_variable(channel, "video_screen_share", "true");
switch_channel_set_flag(channel, CF_VIDEO_ONLY);
}