]> git.0d.be Git - empathy.git/blobdiff - src/empathy-call-window.c
Move should_create_salut_account to local-xmpp-assistant-widget
[empathy.git] / src / empathy-call-window.c
index b57952337c0dc564e9f0e580de4e74adcedcb912..451722839ae57f471c029de1ccac0086174e0d78 100644 (file)
@@ -439,8 +439,11 @@ create_video_output_widget (EmpathyCallWindow *self)
   clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->video_output),
       TRUE);
 
-  priv->video_output_sink = clutter_gst_video_sink_new (
-      CLUTTER_TEXTURE (priv->video_output));
+  priv->video_output_sink = gst_element_factory_make ("cluttersink", NULL);
+  if (priv->video_output_sink == NULL)
+    g_error ("Missing cluttersink");
+  else
+    g_object_set (priv->video_output_sink, "texture", priv->video_output, NULL);
 
   clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_box),
       priv->video_output);
@@ -1113,8 +1116,12 @@ create_video_preview (EmpathyCallWindow *self)
   preview = empathy_rounded_texture_new ();
   clutter_actor_set_size (preview,
       SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT);
-  priv->video_preview_sink = clutter_gst_video_sink_new (
-      CLUTTER_TEXTURE (preview));
+
+  priv->video_preview_sink = gst_element_factory_make ("cluttersink", NULL);
+  if (priv->video_preview_sink == NULL)
+    g_error ("Missing cluttersink");
+  else
+    g_object_set (priv->video_preview_sink, "texture", preview, NULL);
 
   /* Add a little offset to the video preview */
   layout = clutter_bin_layout_new (CLUTTER_BIN_ALIGNMENT_CENTER,
@@ -1717,6 +1724,9 @@ empathy_call_window_init (EmpathyCallWindow *self)
 
   priv->video_container = gtk_clutter_embed_new ();
 
+  gtk_widget_set_size_request (priv->video_container,
+      EMPATHY_VIDEO_WIDGET_DEFAULT_WIDTH, EMPATHY_VIDEO_WIDGET_DEFAULT_HEIGHT);
+
   /* Set the background color to that of the rest of the window */
   context = gtk_widget_get_style_context (priv->content_hbox);
   gtk_style_context_get_background_color (context,
@@ -3362,7 +3372,7 @@ empathy_call_window_src_added_cb (EmpathyCallHandler *handler,
             G_CALLBACK (empathy_call_window_video_probe_cb), self);
         if (priv->got_video_src > 0)
           g_source_remove (priv->got_video_src);
-        priv->got_video_src = g_timeout_add_seconds (5,
+        priv->got_video_src = g_timeout_add_seconds (1,
             empathy_call_window_check_video_cb, self);
         break;
       default:
@@ -4172,3 +4182,23 @@ empathy_call_window_get_video_src (EmpathyCallWindow *self)
 {
   return EMPATHY_GST_VIDEO_SRC (self->priv->video_input);
 }
+
+void
+empathy_call_window_change_webcam (EmpathyCallWindow *self,
+    const gchar *device)
+{
+  EmpathyGstVideoSrc *video;
+  gboolean running;
+
+  /* Restart the camera only if it's already running */
+  running = (self->priv->video_preview != NULL);
+  video = empathy_call_window_get_video_src (self);
+
+  if (running)
+    empathy_call_window_play_camera (self, FALSE);
+
+  empathy_video_src_change_device (video, device);
+
+  if (running)
+    empathy_call_window_play_camera (self, TRUE);
+}