From 5eb2cbb5efe6605128fd918dcdaf5d1dd3f5a8b4 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 22 Jul 2013 10:10:40 +0200 Subject: [PATCH] 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. --- gst-libs/gst/vaapi/gstvaapiutils_x11.c | 4 +++- gst-libs/gst/vaapi/gstvaapiutils_x11.h | 3 ++- gst-libs/gst/vaapi/gstvaapiwindow_x11.c | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapiutils_x11.c b/gst-libs/gst/vaapi/gstvaapiutils_x11.c index 83a13ee904..2b7931b016 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiutils_x11.c @@ -127,7 +127,8 @@ x11_get_geometry( gint *px, gint *py, guint *pwidth, - guint *pheight + guint *pheight, + guint *pdepth ) { Window rootwin; @@ -150,5 +151,6 @@ x11_get_geometry( if (py) *py = y; if (pwidth) *pwidth = width; if (pheight) *pheight = height; + if (pdepth) *pdepth = depth; return TRUE; } diff --git a/gst-libs/gst/vaapi/gstvaapiutils_x11.h b/gst-libs/gst/vaapi/gstvaapiutils_x11.h index 60befa5ffc..252b4ae689 100644 --- a/gst-libs/gst/vaapi/gstvaapiutils_x11.h +++ b/gst-libs/gst/vaapi/gstvaapiutils_x11.h @@ -47,7 +47,8 @@ x11_get_geometry( gint *px, gint *py, guint *pwidth, - guint *pheight + guint *pheight, + guint *pdepth ); #endif /* GST_VAAPI_UTILS_X11_H */ diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c index d5fc0bbd90..a5ea27752e 100644 --- a/gst-libs/gst/vaapi/gstvaapiwindow_x11.c +++ b/gst-libs/gst/vaapi/gstvaapiwindow_x11.c @@ -227,7 +227,7 @@ gst_vaapi_window_x11_create(GstVaapiWindow *window, guint *width, guint *height) GST_VAAPI_OBJECT_LOCK_DISPLAY(window); XGetWindowAttributes(dpy, xid, &wattr); 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); return ok; } @@ -287,7 +287,7 @@ gst_vaapi_window_x11_get_geometry( Display * const dpy = GST_VAAPI_OBJECT_XDISPLAY(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