From 4ec67dd554832275ba6b38ae5bcbe9b0d43148d3 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 3 Feb 2010 12:56:01 +0100 Subject: [PATCH 1/2] save self-view settings. --- coreapi/linphonecore.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 3c46d92a0..e8c88dc0f 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -720,7 +720,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; @@ -748,9 +748,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 } @@ -2986,11 +2987,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)); @@ -3015,7 +3011,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); } /** @@ -3356,7 +3351,7 @@ void rtp_config_uninit(LinphoneCore *lc) lp_config_set_int(lc->config,"rtp","audio_rtp_port",config->audio_rtp_port); lp_config_set_int(lc->config,"rtp","video_rtp_port",config->video_rtp_port); lp_config_set_int(lc->config,"rtp","audio_jitt_comp",config->audio_jitt_comp); - lp_config_set_int(lc->config,"rtp","video_jitt_comp",config->audio_jitt_comp); + lp_config_set_int(lc->config,"rtp","video_jitt_comp",config->video_jitt_comp); lp_config_set_int(lc->config,"rtp","nortp_timeout",config->nortp_timeout); } @@ -3374,7 +3369,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) From 549ab82f08b7176a29ef16f9aec7a3c8cf67685b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 3 Feb 2010 13:00:46 +0100 Subject: [PATCH 2/2] Avoid closing of video window, show it above everything during calls, remove gdk_window_raise because it crashes on some versions of gtk/win32. --- gtk-glade/main.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/gtk-glade/main.c b/gtk-glade/main.c index e6e2ac79a..579c3e34a 100644 --- a/gtk-glade/main.c +++ b/gtk-glade/main.c @@ -369,21 +369,37 @@ static void set_video_window_decorations(GdkWindow *w){ char video_title[256]; GdkPixbuf *pbuf=create_pixbuf(icon_path); if (!linphone_core_in_call(linphone_gtk_get_core())){ - snprintf(video_title,sizeof(video_title),"%s video",title); + snprintf(video_title,sizeof(video_title),"%s video",title); + /* When not in call, treat the video as a normal window */ + gdk_window_set_keep_above(w, FALSE); }else{ - const LinphoneAddress *uri=linphone_core_get_remote_uri(linphone_gtk_get_core()); + LinphoneAddress *uri = + linphone_address_clone(linphone_core_get_remote_uri(linphone_gtk_get_core())); char *display_name; - if (linphone_address_get_display_name(uri)!=NULL) + + linphone_address_clean(uri); + if (linphone_address_get_display_name(uri)!=NULL){ display_name=ms_strdup(linphone_address_get_display_name(uri)); - else{ + }else{ display_name=linphone_address_as_string(uri); } snprintf(video_title,sizeof(video_title),_("Call with %s"),display_name); + linphone_address_destroy(uri); ms_free(display_name); + + /* During calls, bring up the video window, arrange so that + it is above all the other windows */ + gdk_window_deiconify(w); + gdk_window_set_keep_above(w,TRUE); + /* Maybe we should have the following, but then we want to + have a timer that turns it off after a little while. */ + /* gdk_window_set_urgency_hint(w,TRUE); */ } gdk_window_set_title(w,video_title); - /*gdk_window_set_urgency_hint(w,TRUE);*/ - gdk_window_raise(w); + /* Refrain the video window to be closed at all times. */ + gdk_window_set_functions(w, + GDK_FUNC_RESIZE|GDK_FUNC_MOVE| + GDK_FUNC_MINIMIZE|GDK_FUNC_MAXIMIZE); if (pbuf){ GList *l=NULL; l=g_list_append(l,pbuf);