[empathy] Don't call GTK method from streaming thread
- From: Sjoerd Simons <sjoerds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] Don't call GTK method from streaming thread
- Date: Mon, 7 Nov 2011 20:07:55 +0000 (UTC)
commit f0f72ca31e1500e7e57d15b817ca0cecf2c9d060
Author: Nicolas Dufresne <nicolas dufresne collabora com>
Date: Thu Jul 7 14:27:30 2011 -0400
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().
src/empathy-video-widget.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/empathy-video-widget.c b/src/empathy-video-widget.c
index ec26f19..0eee9e0 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]