aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-03-28 16:17:42 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-03-28 16:17:42 +0800
commit9ec50f65cebd0803269942fb970d6c253d184e17 (patch)
treec2c0103e27a04be715aa06fd89010d6ef0e55d20
parent0400205036f01b8e42271cdd442a15927a06b070 (diff)
downloadgsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar.gz
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar.bz2
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar.lz
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar.xz
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.tar.zst
gsoc2013-empathy-9ec50f65cebd0803269942fb970d6c253d184e17.zip
Add colorspace and videoscale elements before the videosink
Farsight only adds colorspace and videoscale automatically on the input side of things, not on the output side. This causes things to break when the videosink isn't xvimagesink which can do scaling and colorspace conversion in hardware. Fixes gbz #576386 From: Sjoerd Simons <sjoerd.simons@collabora.co.uk> svn path=/trunk/; revision=2746
-rw-r--r--libempathy-gtk/empathy-video-widget.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-video-widget.c b/libempathy-gtk/empathy-video-widget.c
index 5b76257f4..4c7bee9db 100644
--- a/libempathy-gtk/empathy-video-widget.c
+++ b/libempathy-gtk/empathy-video-widget.c
@@ -103,13 +103,47 @@ static void
empathy_video_widget_constructed (GObject *object)
{
EmpathyVideoWidgetPriv *priv = GET_PRIV (object);
+ GstElement *colorspace, *videoscale, *sink;
+ GstPad *pad;
+
+ priv->videosink = gst_bin_new (NULL);
- priv->videosink = gst_element_factory_make ("gconfvideosink", NULL);
gst_object_ref (priv->videosink);
gst_object_sink (priv->videosink);
priv->sink_pad = gst_element_get_static_pad (priv->videosink, "sink");
+ sink = gst_element_factory_make ("gconfvideosink", NULL);
+ g_assert (sink != NULL);
+
+ videoscale = gst_element_factory_make ("videoscale", NULL);
+ g_assert (videoscale != NULL);
+
+ g_object_set (videoscale, "qos", FALSE, NULL);
+
+ colorspace = gst_element_factory_make ("ffmpegcolorspace", NULL);
+ g_assert (colorspace != NULL);
+
+ g_object_set (colorspace, "qos", FALSE, NULL);
+
+ gst_bin_add_many (GST_BIN (priv->videosink), colorspace, videoscale,
+ sink, NULL);
+
+ if (!gst_element_link (colorspace, videoscale))
+ g_error ("Failed to link ffmpegcolorspace and videoscale");
+
+ if (!gst_element_link (videoscale, sink))
+ g_error ("Failed to link videoscale and gconfvideosink");
+
+ pad = gst_element_get_static_pad (colorspace, "sink");
+ g_assert (pad != NULL);
+
+ priv->sink_pad = gst_ghost_pad_new ("sink", pad);
+ if (!gst_element_add_pad (priv->videosink, priv->sink_pad))
+ g_error ("Couldn't add sink ghostpad to the bin");
+
+ gst_object_unref (pad);
+
fs_element_added_notifier_add (priv->notifier, GST_BIN (priv->videosink));
gst_bus_enable_sync_message_emission (priv->bus);