]> sjero.net Git - linphone/commitdiff
add --no-video option to gtk app
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 1 Jun 2012 12:46:58 +0000 (14:46 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 1 Jun 2012 12:46:58 +0000 (14:46 +0200)
gtk/main.c
mediastreamer2

index fc8a6bfccb91f79e9e5fa244c61332911792e0ca..2a6c307b61d5f2d38245fdc8cd6a869ce5acf128 100644 (file)
@@ -18,7 +18,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
 
 
-#define VIDEOSELFVIEW_DEFAULT 1
+#define VIDEOSELFVIEW_DEFAULT 0
 
 #include "linphone.h"
 #include "lpconfig.h"
@@ -66,11 +66,13 @@ static void linphone_gtk_call_encryption_changed(LinphoneCore *lc, LinphoneCall
 static void linphone_gtk_transfer_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate);
 static gboolean linphone_gtk_auto_answer(LinphoneCall *call);
 static void linphone_gtk_status_icon_set_blinking(gboolean val);
+void _linphone_gtk_enable_video(gboolean val);
 
 
 static gboolean verbose=0;
 static gboolean auto_answer = 0;
 static gchar * addr_to_call = NULL;
+static gboolean no_video=FALSE;
 static gboolean iconified=FALSE;
 static gchar *workingdir=NULL;
 static char *progpath=NULL;
@@ -91,6 +93,13 @@ static GOptionEntry linphone_options[]={
            .arg_data = &linphone_logfile,
            .description = N_("path to a file to write logs into.")
        },
+       {
+           .long_name = "no-video",
+           .short_name = '\0',
+           .arg = G_OPTION_ARG_NONE,
+           .arg_data = (gpointer)&no_video,
+           .description = N_("Start linphone with video disabled.")
+       },
        {
                .long_name="iconified",
                .short_name= '\0',
@@ -234,6 +243,10 @@ static void linphone_gtk_init_liblinphone(const char *config_file,
        linphone_core_set_zrtp_secrets_file(the_core,secrets_file);
        g_free(secrets_file);
        linphone_core_enable_video(the_core,TRUE,TRUE);
+       if (no_video) {
+               _linphone_gtk_enable_video(FALSE);
+               linphone_gtk_set_ui_config_int("videoselfview",0);
+       }
 }
 
 
@@ -648,10 +661,8 @@ bool_t linphone_gtk_video_enabled(void){
 void linphone_gtk_show_main_window(){
        GtkWidget *w=linphone_gtk_get_main_window();
        LinphoneCore *lc=linphone_gtk_get_core();
-       if (linphone_gtk_video_enabled()){
-               linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview",
+       linphone_core_enable_video_preview(lc,linphone_gtk_get_ui_config_int("videoselfview",
                VIDEOSELFVIEW_DEFAULT));
-       }
        gtk_widget_show(w);
        gtk_window_present(GTK_WINDOW(w));
 }
@@ -772,9 +783,7 @@ void linphone_gtk_answer_clicked(GtkWidget *button){
        }
 }
 
-void linphone_gtk_enable_video(GtkWidget *w){
-       gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
-       //GtkWidget *selfview_item=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"selfview_item");
+void _linphone_gtk_enable_video(gboolean val){
        LinphoneVideoPolicy policy={0};
        policy.automatically_initiate=policy.automatically_accept=val;
        linphone_core_enable_video(linphone_gtk_get_core(),TRUE,TRUE);
@@ -788,6 +797,12 @@ void linphone_gtk_enable_video(GtkWidget *w){
        }
 }
 
+void linphone_gtk_enable_video(GtkWidget *w){
+       gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
+       //GtkWidget *selfview_item=linphone_gtk_get_widget(linphone_gtk_get_main_window(),"selfview_item");
+       _linphone_gtk_enable_video(val);
+}
+
 void linphone_gtk_enable_self_view(GtkWidget *w){
        gboolean val=gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w));
        LinphoneCore *lc=linphone_gtk_get_core();
index 38d2d7411a6fb3cd61d33234a16b88ade1967b4d..343d9116b35e2f80c01e77a4bc7bbf898126cd53 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 38d2d7411a6fb3cd61d33234a16b88ade1967b4d
+Subproject commit 343d9116b35e2f80c01e77a4bc7bbf898126cd53