mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
Check whether the foreign XID is mapped at binding time.
This commit is contained in:
parent
8bc05b84d0
commit
0bf40c2d44
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue