Use XGetGeometry() to retrieve the window size.

This commit is contained in:
gb 2010-05-13 04:22:31 +00:00 committed by Gwenole Beauchesne
parent b3dc91b1d9
commit 3a7c049829

View file

@ -292,25 +292,27 @@ gst_vaapisink_ensure_window(GstVaapiSink *sink, guint width, guint height)
static gboolean static gboolean
gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, XID xid) gst_vaapisink_ensure_window_xid(GstVaapiSink *sink, XID xid)
{ {
XWindowAttributes wattr; Window rootwin;
unsigned int width, height, border_width, depth;
int x, y;
if (!gst_vaapisink_ensure_display(sink)) if (!gst_vaapisink_ensure_display(sink))
return FALSE; return FALSE;
gst_vaapi_display_lock(sink->display); gst_vaapi_display_lock(sink->display);
XGetWindowAttributes( XGetGeometry(
gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(sink->display)), gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(sink->display)),
xid, xid,
&wattr &rootwin,
&x, &y, &width, &height, &border_width, &depth
); );
gst_vaapi_display_unlock(sink->display); gst_vaapi_display_unlock(sink->display);
if (wattr.width != sink->window_width || if (width != sink->window_width || height != sink->window_height) {
wattr.height != sink->window_height) { if (!gst_vaapisink_ensure_render_rect(sink, width, height))
if (!gst_vaapisink_ensure_render_rect(sink, wattr.width, wattr.height))
return FALSE; return FALSE;
sink->window_width = wattr.width; sink->window_width = width;
sink->window_height = wattr.height; sink->window_height = height;
} }
if (sink->window && if (sink->window &&