]> git.0d.be Git - empathy.git/commitdiff
factor out empathy_call_window_change_webcam()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 21 Nov 2011 10:43:51 +0000 (11:43 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 23 Nov 2011 09:59:52 +0000 (10:59 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=664459

src/empathy-call-window.c
src/empathy-call-window.h
src/empathy-camera-menu.c

index 732f45e8ac72c816aace1c7932f9913f372353ce..6e2df7961c0c761e6f350eeb56a61a03533c4c39 100644 (file)
@@ -4175,3 +4175,16 @@ empathy_call_window_get_video_src (EmpathyCallWindow *self)
 {
   return EMPATHY_GST_VIDEO_SRC (self->priv->video_input);
 }
 {
   return EMPATHY_GST_VIDEO_SRC (self->priv->video_input);
 }
+
+void
+empathy_call_window_change_webcam (EmpathyCallWindow *self,
+    const gchar *device)
+{
+  EmpathyGstVideoSrc *video;
+
+  video = empathy_call_window_get_video_src (self);
+
+  empathy_call_window_play_camera (self, FALSE);
+  empathy_video_src_change_device (video, device);
+  empathy_call_window_play_camera (self, TRUE);
+}
index 81cf170aef42669797c1459c2efaba5e929958a6..abaae276308b0ea126a1db4bb5996d822f8ea791 100644 (file)
@@ -78,6 +78,9 @@ EmpathyGstVideoSrc *empathy_call_window_get_video_src (EmpathyCallWindow *window
 void empathy_call_window_play_camera (EmpathyCallWindow *self,
     gboolean play);
 
 void empathy_call_window_play_camera (EmpathyCallWindow *self,
     gboolean play);
 
+void empathy_call_window_change_webcam (EmpathyCallWindow *self,
+    const gchar *device);
+
 G_END_DECLS
 
 #endif /* #ifndef __EMPATHY_CALL_WINDOW_H__*/
 G_END_DECLS
 
 #endif /* #ifndef __EMPATHY_CALL_WINDOW_H__*/
index cee11d75978d40746a7e195c9a42dbba543c326c..9633d84fa2b78eb2674c92e3c3c573f55230fde9 100644 (file)
@@ -146,9 +146,7 @@ empathy_camera_menu_activate_cb (GtkAction *action,
   if (!tp_strdiff (device, current_device))
     goto out;
 
   if (!tp_strdiff (device, current_device))
     goto out;
 
-  empathy_call_window_play_camera (self->priv->window, FALSE);
-  empathy_video_src_change_device (video, device);
-  empathy_call_window_play_camera (self->priv->window, TRUE);
+  empathy_call_window_change_webcam (self->priv->window, device);
 
  out:
   g_free (current_device);
 
  out:
   g_free (current_device);