mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
x11: update x11_get_geometry() helper function with depth output.
Allow x11_get_geometry() utility function to also return the depth assigned to the X drawable.
This commit is contained in:
parent
5cabf4e305
commit
5eb2cbb5ef
3 changed files with 7 additions and 4 deletions
|
@ -127,7 +127,8 @@ x11_get_geometry(
|
||||||
gint *px,
|
gint *px,
|
||||||
gint *py,
|
gint *py,
|
||||||
guint *pwidth,
|
guint *pwidth,
|
||||||
guint *pheight
|
guint *pheight,
|
||||||
|
guint *pdepth
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Window rootwin;
|
Window rootwin;
|
||||||
|
@ -150,5 +151,6 @@ x11_get_geometry(
|
||||||
if (py) *py = y;
|
if (py) *py = y;
|
||||||
if (pwidth) *pwidth = width;
|
if (pwidth) *pwidth = width;
|
||||||
if (pheight) *pheight = height;
|
if (pheight) *pheight = height;
|
||||||
|
if (pdepth) *pdepth = depth;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,8 @@ x11_get_geometry(
|
||||||
gint *px,
|
gint *px,
|
||||||
gint *py,
|
gint *py,
|
||||||
guint *pwidth,
|
guint *pwidth,
|
||||||
guint *pheight
|
guint *pheight,
|
||||||
|
guint *pdepth
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif /* GST_VAAPI_UTILS_X11_H */
|
#endif /* GST_VAAPI_UTILS_X11_H */
|
||||||
|
|
|
@ -227,7 +227,7 @@ gst_vaapi_window_x11_create(GstVaapiWindow *window, guint *width, guint *height)
|
||||||
GST_VAAPI_OBJECT_LOCK_DISPLAY(window);
|
GST_VAAPI_OBJECT_LOCK_DISPLAY(window);
|
||||||
XGetWindowAttributes(dpy, xid, &wattr);
|
XGetWindowAttributes(dpy, xid, &wattr);
|
||||||
priv->is_mapped = wattr.map_state == IsViewable;
|
priv->is_mapped = wattr.map_state == IsViewable;
|
||||||
ok = x11_get_geometry(dpy, xid, NULL, NULL, width, height);
|
ok = x11_get_geometry(dpy, xid, NULL, NULL, width, height, NULL);
|
||||||
GST_VAAPI_OBJECT_UNLOCK_DISPLAY(window);
|
GST_VAAPI_OBJECT_UNLOCK_DISPLAY(window);
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
@ -287,7 +287,7 @@ gst_vaapi_window_x11_get_geometry(
|
||||||
Display * const dpy = GST_VAAPI_OBJECT_XDISPLAY(window);
|
Display * const dpy = GST_VAAPI_OBJECT_XDISPLAY(window);
|
||||||
const Window xid = GST_VAAPI_OBJECT_ID(window);
|
const Window xid = GST_VAAPI_OBJECT_ID(window);
|
||||||
|
|
||||||
return x11_get_geometry(dpy, xid, px, py, pwidth, pheight);
|
return x11_get_geometry(dpy, xid, px, py, pwidth, pheight, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue