]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_verto] get the conference to send a keyframe when you reload/attach so the video...
authorAnthony Minessale <anthm@signalwire.com>
Fri, 10 Apr 2020 21:36:37 +0000 (21:36 +0000)
committerAndrey Volk <andywolk@gmail.com>
Sat, 23 Oct 2021 19:00:21 +0000 (22:00 +0300)
src/mod/applications/mod_conference/conference_video.c
src/mod/endpoints/mod_verto/mod_verto.c

index 357f30a56024a62210b4c280eb973acefa6760c8..e94b835c3d9405bdade5221636e45dfaefe550a0 100644 (file)
@@ -3344,7 +3344,8 @@ void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread_t *thr
 
                        if (imember->watching_canvas_id == canvas->canvas_id && switch_channel_test_flag(imember->channel, CF_VIDEO_REFRESH_REQ)) {
                                switch_channel_clear_flag(imember->channel, CF_VIDEO_REFRESH_REQ);
-                               send_keyframe = SWITCH_TRUE;
+                               canvas->send_keyframe = 30;
+                               send_keyframe = 1;
                        }
 
                        if (conference_utils_test_flag(conference, CFLAG_MINIMIZE_VIDEO_ENCODING) &&
index 4d02fee4f8d5c32028d44f816b06cd24e208e6ca..a5c0c1c841d84726805c57dfe1bfd8582a3011ff 100644 (file)
@@ -1239,6 +1239,8 @@ static void tech_reattach(verto_pvt_t *tech_pvt, jsock_t *jsock)
                                          switch_channel_get_name(tech_pvt->channel),
                                          tech_pvt->mparams->local_sdp_str);
        set_call_params(params, tech_pvt);
+       switch_core_media_gen_key_frame(tech_pvt->session);
+       switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_REFRESH_REQ);
        jsock_queue_event(jsock, &msg, SWITCH_TRUE);
 }
 
@@ -3484,6 +3486,17 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
                }
        }
 
+       if (tech_pvt) { 
+               if (err) {
+                       if (tech_pvt->channel) {
+                               switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL);
+                       }
+               } else {
+                       switch_core_media_gen_key_frame(tech_pvt->session);
+                       switch_channel_set_flag(tech_pvt->channel, CF_VIDEO_REFRESH_REQ);
+               }
+       }
+       
        if (session) {
                switch_core_session_rwunlock(session);
        }
@@ -3492,11 +3505,6 @@ static switch_bool_t verto__attach_func(const char *method, cJSON *params, jsock
                return SWITCH_TRUE;
        }
 
-       if (tech_pvt && tech_pvt->channel) {
-               switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_BEARERCAPABILITY_NOTAVAIL);
-       }
-
-
        cJSON_AddItemToObject(obj, "code", cJSON_CreateNumber(CODE_SESSION_ERROR));
 
        return SWITCH_FALSE;