[empathy] call: port to clutter-gst 3.0



commit f781ba2aa3c5e7b95efabed1ed01ec0aecf57b22
Author: Lionel Landwerlin <lionel g landwerlin intel com>
Date:   Mon Nov 30 15:19:39 2015 +0000

    call: port to clutter-gst 3.0
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751185

 configure.ac              |    2 +-
 src/empathy-call-window.c |   28 ++++++++++++++--------------
 2 files changed, 15 insertions(+), 15 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 68161c4..ce1ae4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -248,7 +248,7 @@ PKG_CHECK_MODULES(EMPATHY_CALL,
    telepathy-farstream >= $TP_FS_REQUIRED
    clutter-1.0 >= $CLUTTER_REQUIRED
    clutter-gtk-1.0 >= $CLUTTER_GTK_REQUIRED
-   clutter-gst-2.0
+   clutter-gst-3.0
    gstreamer-1.0
    gstreamer-audio-1.0
    gstreamer-video-1.0
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index a54346c..fd664ed 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -22,6 +22,7 @@
 #include "empathy-call-window.h"
 
 #include <glib/gi18n.h>
+#include <clutter-gst/clutter-gst.h>
 #include <telepathy-farstream/telepathy-farstream.h>
 #include <farstream/fs-element-added-notifier.h>
 #include <farstream/fs-utils.h>
@@ -391,19 +392,17 @@ create_video_output_widget (EmpathyCallWindow *self)
   g_assert (priv->video_output == NULL);
   g_assert (priv->pipeline != NULL);
 
-  priv->video_output = clutter_texture_new ();
-
-  clutter_texture_set_keep_aspect_ratio (CLUTTER_TEXTURE (priv->video_output),
-      TRUE);
-
-  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);
+  priv->video_output_sink = GST_ELEMENT (clutter_gst_video_sink_new ());
+  priv->video_output = g_object_new (CLUTTER_TYPE_ACTOR,
+      "content", g_object_new (CLUTTER_GST_TYPE_ASPECTRATIO,
+                               "sink", priv->video_output_sink,
+                               NULL),
+      NULL);
 
   clutter_container_add_actor (CLUTTER_CONTAINER (priv->video_box),
       priv->video_output);
+  clutter_actor_add_constraint (priv->video_output,
+      clutter_bind_constraint_new (priv->video_box, CLUTTER_BIND_SIZE, 0));
 
   gtk_widget_add_events (priv->video_container,
       GDK_BUTTON_PRESS_MASK | GDK_POINTER_MOTION_MASK);
@@ -1077,10 +1076,7 @@ create_video_preview (EmpathyCallWindow *self)
   clutter_actor_set_size (preview,
       SELF_VIDEO_SECTION_WIDTH, SELF_VIDEO_SECTION_HEIGHT);
 
-  priv->video_preview_sink = gst_element_factory_make ("cluttersink", NULL);
-  if (priv->video_preview_sink == NULL)
-      g_error ("Missing cluttersink, check your clutter-gst installation");
-  g_object_set (priv->video_preview_sink, "texture", preview, NULL);
+  priv->video_preview_sink = GST_ELEMENT (clutter_gst_video_sink_new ());
   g_object_add_weak_pointer (G_OBJECT (priv->video_preview_sink), (gpointer) &priv->video_preview_sink);
 
   /* Add a little offset to the video preview */
@@ -1090,6 +1086,10 @@ create_video_preview (EmpathyCallWindow *self)
   clutter_actor_set_size (priv->video_preview,
       SELF_VIDEO_SECTION_WIDTH + 2 * SELF_VIDEO_SECTION_MARGIN,
       SELF_VIDEO_SECTION_HEIGHT + 2 * SELF_VIDEO_SECTION_MARGIN);
+  clutter_actor_set_content (priv->video_preview,
+      g_object_new (CLUTTER_GST_TYPE_ASPECTRATIO,
+                    "sink", priv->video_preview,
+                    NULL));
 
   /* Spinner for when changing the camera device */
   priv->preview_spinner_widget = gtk_spinner_new ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]