aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2011-07-08 02:27:30 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2011-11-08 04:07:19 +0800
commitf0f72ca31e1500e7e57d15b817ca0cecf2c9d060 (patch)
tree9ec7f0fee56446dd7bfe70e9ba471f7524fabeb5
parentd41e4f40e98cca99005a344a738e0468ae3b84bf (diff)
downloadgsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar.gz
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar.bz2
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar.lz
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar.xz
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.tar.zst
gsoc2013-empathy-f0f72ca31e1500e7e57d15b817ca0cecf2c9d060.zip
Don't call GTK method from streaming thread
Also update from deprecated gst_x_overlay_set_xwindow_id() to gst_x_overlay_set_window_handle().
-rw-r--r--src/empathy-video-widget.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/empathy-video-widget.c b/src/empathy-video-widget.c
index ec26f1949..0eee9e0bc 100644
--- a/src/empathy-video-widget.c
+++ b/src/empathy-video-widget.c
@@ -76,6 +76,7 @@ struct _EmpathyVideoWidgetPriv
gboolean sync;
gboolean async;
gboolean flip_video;
+ guintptr xid;
GMutex *lock;
};
@@ -105,11 +106,13 @@ empathy_video_widget_init (EmpathyVideoWidget *obj)
static void
empathy_video_widget_realized (GtkWidget *widget, gpointer user_data)
{
+ EmpathyVideoWidgetPriv *priv = GET_PRIV (widget);
+
/* requesting the XID forces the GdkWindow to be native in GTK+ 2.18
* onwards, requesting the native window in a thread causes a BadWindowID,
* so we need to request it now. We could call gdk_window_ensure_native(),
* but that would mean we require GTK+ 2.18, so instead we call this */
- GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (widget)));
+ priv->xid = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (widget)));
}
static void
@@ -440,9 +443,9 @@ empathy_video_widget_sync_message_cb (GstBus *bus, GstMessage *message,
if (gst_structure_has_name (s, "prepare-xwindow-id"))
{
- g_assert (gtk_widget_get_realized (GTK_WIDGET (self)));
- gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (priv->overlay),
- GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (self))));
+ g_assert (priv->xid != 0);
+ gst_x_overlay_set_window_handle (GST_X_OVERLAY (priv->overlay),
+ priv->xid);
}
}