aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@src.gnome.org>2012-11-08 21:51:04 +0800
committerDebarshi Ray <debarshir@gnome.org>2012-11-09 19:00:03 +0800
commit34b5179278427a9654d1743d91091a5a2d6400aa (patch)
tree73324ed036fe40a165e7b115463ff21b103181d7 /src
parent26d065a98a9dab0c204f3d375f5d232585523fd2 (diff)
downloadgsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar.gz
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar.bz2
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar.lz
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar.xz
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.tar.zst
gsoc2013-empathy-34b5179278427a9654d1743d91091a5a2d6400aa.zip
empathy-call: Handle yanking out of current video input
If the current video input is yanked out, we continue the call with only audio and desensitize the camera menu. Once the call is over we sensitize it again and continue. Fixes: https://bugzilla.gnome.org/687928
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c8
-rw-r--r--src/empathy-camera-menu.c24
-rw-r--r--src/empathy-camera-menu.h3
3 files changed, 31 insertions, 4 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 64cda3d01..91d02a195 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -2617,6 +2617,13 @@ empathy_call_window_disconnected (EmpathyCallWindow *self,
gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
gtk_widget_set_sensitive (priv->dtmf_panel, FALSE);
+ /* Create the video input and then turn on the camera
+ * menu, so that the active camera gets marked as such.
+ */
+ if (priv->video_input == NULL)
+ create_video_input (self);
+ empathy_camera_menu_set_sensitive (priv->camera_menu, TRUE);
+
could_reset_pipeline = empathy_call_window_reset_pipeline (self);
if (priv->call_state == CONNECTING)
@@ -3644,6 +3651,7 @@ empathy_call_window_remove_video_input (EmpathyCallWindow *self)
priv->video_preview = NULL;
gtk_widget_set_sensitive (priv->camera_button, FALSE);
+ empathy_camera_menu_set_sensitive (priv->camera_menu, FALSE);
}
static void
diff --git a/src/empathy-camera-menu.c b/src/empathy-camera-menu.c
index 9633d84fa..a0e0ca6fa 100644
--- a/src/empathy-camera-menu.c
+++ b/src/empathy-camera-menu.c
@@ -132,15 +132,16 @@ empathy_camera_menu_activate_cb (GtkAction *action,
{
EmpathyGstVideoSrc *video;
const gchar *device;
- gchar *current_device;
+ gchar *current_device = NULL;
if (self->priv->in_update)
return;
video = empathy_call_window_get_video_src (self->priv->window);
+ if (video != NULL)
+ current_device = empathy_video_src_dup_device (video);
device = gtk_action_get_name (action);
- current_device = empathy_video_src_dup_device (video);
/* Don't change the device if it's the currently used one */
if (!tp_strdiff (device, current_device))
@@ -158,12 +159,13 @@ empathy_camera_menu_update (EmpathyCameraMenu *self)
GList *l;
GtkUIManager *ui_manager;
EmpathyGstVideoSrc *video;
- gchar *current_camera;
+ gchar *current_camera = NULL;
ui_manager = empathy_call_window_get_ui_manager (self->priv->window);
video = empathy_call_window_get_video_src (self->priv->window);
- current_camera = empathy_video_src_dup_device (video);
+ if (video != NULL)
+ current_camera = empathy_video_src_dup_device (video);
empathy_camera_menu_clean (self);
self->priv->ui_id = gtk_ui_manager_new_merge_id (ui_manager);
@@ -394,3 +396,17 @@ empathy_camera_menu_new (EmpathyCallWindow *window)
"window", window,
NULL);
}
+
+void
+empathy_camera_menu_set_sensitive (EmpathyCameraMenu *self,
+ gboolean sensitive)
+{
+ GtkUIManager *ui_manager;
+
+ gtk_action_group_set_sensitive (self->priv->action_group, sensitive);
+ if (sensitive) /* Mark the active camera as such. */
+ empathy_camera_menu_update (self);
+
+ ui_manager = empathy_call_window_get_ui_manager (self->priv->window);
+ gtk_ui_manager_ensure_update (ui_manager);
+}
diff --git a/src/empathy-camera-menu.h b/src/empathy-camera-menu.h
index f105baf22..92760f67d 100644
--- a/src/empathy-camera-menu.h
+++ b/src/empathy-camera-menu.h
@@ -51,6 +51,9 @@ GType empathy_camera_menu_get_type (void) G_GNUC_CONST;
EmpathyCameraMenu * empathy_camera_menu_new (EmpathyCallWindow *window);
+void empathy_camera_menu_set_sensitive (EmpathyCameraMenu *self,
+ gboolean sensitive);
+
G_END_DECLS
#endif /* __EMPATHY_CAMERA_MENU_H__ */