From 0bf40c2d44b3dab2961386f892f7d24aa2f50614 Mon Sep 17 00:00:00 2001 From: gb Date: Tue, 23 Mar 2010 07:42:05 +0000 Subject: [PATCH] Check whether the foreign XID is mapped at binding time. --- gst-libs/gst/vaapi/gstvaapiwindow_x11.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index 6273ed0212..18450df43a 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -198,6 +198,7 @@ gst_vaapi_window_x11_create(GstVaapiWindow *window, guint *width, guint *height) { GstVaapiWindowX11Private * const priv = GST_VAAPI_WINDOW_X11(window)->priv; Display * const dpy = GST_VAAPI_DISPLAY_XDISPLAY(priv->display); + XWindowAttributes wattr; Atom atoms[2]; gboolean ok; @@ -208,6 +209,8 @@ gst_vaapi_window_x11_create(GstVaapiWindow *window, guint *width, guint *height) if (!priv->create_window && priv->xid) { GST_VAAPI_DISPLAY_LOCK(priv->display); + XGetWindowAttributes(dpy, priv->xid, &wattr); + priv->is_mapped = wattr.map_state == IsViewable; ok = x11_get_geometry(dpy, priv->xid, NULL, NULL, width, height); GST_VAAPI_DISPLAY_UNLOCK(priv->display); return ok;