]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
Merge branch 'master' into dev_sal
[linphone] / coreapi / linphonecore.c
index 7039a82259f38551e42636603c600bfa8180641d..98f6d811fff509870a4cb2ac6fe4f6321a72470f 100644 (file)
@@ -697,7 +697,7 @@ static void codecs_config_read(LinphoneCore *lc)
 
 static void video_config_read(LinphoneCore *lc)
 {
-       int capture, display;
+       int capture, display, self_view;
        int enabled;
        const char *str;
        int ndev;
@@ -725,9 +725,10 @@ static void video_config_read(LinphoneCore *lc)
        enabled=lp_config_get_int(lc->config,"video","enabled",1);
        capture=lp_config_get_int(lc->config,"video","capture",enabled);
        display=lp_config_get_int(lc->config,"video","display",enabled);
+       self_view=lp_config_get_int(lc->config,"video","self_view",enabled);
 #ifdef VIDEO_ENABLED
        linphone_core_enable_video(lc,capture,display);
-       linphone_core_enable_self_view(lc,TRUE);
+       linphone_core_enable_self_view(lc,self_view);
 #endif
 }
 
@@ -2765,11 +2766,6 @@ void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t di
        lc->video_conf.capture=vcap_enabled;
        lc->video_conf.display=display_enabled;
 
-       if (lc->ready){
-               lp_config_set_int(lc->config,"video","display",display_enabled);
-               lp_config_set_int(lc->config,"video","capture",vcap_enabled);
-       }
-
        /* need to re-apply network bandwidth settings*/
        linphone_core_set_download_bandwidth(lc,
                linphone_core_get_download_bandwidth(lc));
@@ -2794,7 +2790,6 @@ bool_t linphone_core_video_enabled(LinphoneCore *lc){
 **/
 void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val){
        lc->video_conf.show_local=val;
-       if (lc->ready) lp_config_set_int(lc->config,"video","show_local",val);
 }
 
 /**
@@ -3149,7 +3144,12 @@ void sound_config_uninit(LinphoneCore *lc)
 
 void video_config_uninit(LinphoneCore *lc)
 {
-
+       lp_config_set_int(lc->config,"video","enabled",linphone_core_video_enabled(lc));
+       lp_config_set_string(lc->config,"video","size",video_size_get_name(linphone_core_get_preferred_video_size(lc)));
+       lp_config_set_int(lc->config,"video","display",lc->video_conf.display);
+       lp_config_set_int(lc->config,"video","capture",lc->video_conf.capture);
+       lp_config_set_int(lc->config,"video","show_local",linphone_core_video_preview_enabled(lc));
+       lp_config_set_int(lc->config,"video","self_view",linphone_core_self_view_enabled(lc));
 }
 
 void codecs_config_uninit(LinphoneCore *lc)