1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
From 3269cc87e9a18d57552c1cc2556e9138b02adf15 Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date: Mon, 30 Nov 2015 15:19:39 +0000
Subject: [PATCH] call: port to clutter-gst 3.0
https://bugzilla.gnome.org/show_bug.cgi?id=751185
---
configure.ac | 2 +-
src/empathy-call-window.c | 30 +++++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/configure.ac b/configure.ac
index 992a17b..1fef3af 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,7 +247,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..dbef578 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 = 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);
@@ -1063,7 +1062,7 @@ static void
create_video_preview (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
- ClutterLayoutManager *layout;
+ ClutterLayoutManager *layout, *sublayout;
ClutterActor *preview;
ClutterActor *b;
ClutterAction *action;
@@ -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 = 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 ();
--
2.6.2
|