]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7800 should be able to call extra screens with same extension as the original...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Mar 2016 19:54:31 +0000 (14:54 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 18 Mar 2016 19:54:31 +0000 (14:54 -0500)
src/mod/applications/mod_conference/conference_member.c
src/mod/endpoints/mod_verto/mod_verto.c

index f0d1c2c7a73001c91662c88c320806a8ea25031c..6eb2668331fa4fbccacd75936211d6bc35a8a4e1 100644 (file)
@@ -738,6 +738,10 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
 
                conference_video_check_avatar(member, SWITCH_FALSE);
 
+               if (switch_true(switch_channel_get_variable_dup(member->channel, "video_second_screen", SWITCH_FALSE, -1))) {
+                       conference_utils_member_set_flag(member, MFLAG_SECOND_SCREEN);
+               }
+
                if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_canvas", SWITCH_FALSE, -1))) {
                        uint32_t id = atoi(var) - 1;
                        if (id < conference->canvas_count) {
@@ -748,16 +752,16 @@ switch_status_t conference_member_add(conference_obj_t *conference, conference_m
 
                if ((var = switch_channel_get_variable_dup(member->channel, "video_initial_watching_canvas", SWITCH_FALSE, -1))) {
                        uint32_t id = atoi(var) - 1;
-
+                       
                        if (id == 0) {
                                id = conference->canvas_count;
                        }
-
+                       
                        if (id <= conference->canvas_count && conference->canvases[id]) {
                                member->watching_canvas_id = id;
                        }
                }
-
+               
                conference_video_reset_member_codec_index(member);
 
                if (has_video) {
index 58fc3499cd608e46297c8dddda1a1b049ef9c664..c4a4cd72ed3ef95fdfdb6eede38913b8225f51d5 100644 (file)
@@ -3350,7 +3350,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, *json_ptr = NULL, *bandwidth = NULL;
+       cJSON *obj = cJSON_CreateObject(), *screenShare = NULL, *dedEnc = NULL, *mirrorInput, *json_ptr = NULL, *bandwidth = NULL, *canvas = NULL;
        switch_core_session_t *session = NULL;
        switch_channel_t *channel;
        switch_event_t *var_event;
@@ -3433,6 +3433,21 @@ static switch_bool_t verto__invite_func(const char *method, cJSON *params, jsock
                switch_channel_set_flag(channel, CF_VIDEO_MIRROR_INPUT);
        }
 
+       if ((canvas = cJSON_GetObjectItem(dialog, "conferenceCanvasID"))) {
+               int canvas_id = 0;
+               
+               if (!zstr(canvas->valuestring)) {
+                       canvas_id = atoi(canvas->valuestring);
+               } else if (canvas->valueint) {
+                       canvas_id = canvas->valueint;
+               }
+
+               if (canvas_id >= 0) {
+                       switch_channel_set_variable_printf(channel, "video_initial_watching_canvas", "%d", canvas_id);
+                       switch_channel_set_variable(channel, "video_second_screen", "true");
+               }
+       }
+
        if ((bandwidth = cJSON_GetObjectItem(dialog, "outgoingBandwidth"))) {
                int core_bw = 0, bwval = 0;
                const char *val;