mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
Use XGetGeometry() to retrieve the window size.
This commit is contained in:
parent
b3dc91b1d9
commit
3a7c049829
1 changed files with 10 additions and 8 deletions
|
@ -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 &&
|
||||||
|
|
Loading…
Reference in a new issue