mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 09:40:37 +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
|
||||
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))
|
||||
return FALSE;
|
||||
|
||||
gst_vaapi_display_lock(sink->display);
|
||||
XGetWindowAttributes(
|
||||
XGetGeometry(
|
||||
gst_vaapi_display_x11_get_display(GST_VAAPI_DISPLAY_X11(sink->display)),
|
||||
xid,
|
||||
&wattr
|
||||
&rootwin,
|
||||
&x, &y, &width, &height, &border_width, &depth
|
||||
);
|
||||
gst_vaapi_display_unlock(sink->display);
|
||||
|
||||
if (wattr.width != sink->window_width ||
|
||||
wattr.height != sink->window_height) {
|
||||
if (!gst_vaapisink_ensure_render_rect(sink, wattr.width, wattr.height))
|
||||
if (width != sink->window_width || height != sink->window_height) {
|
||||
if (!gst_vaapisink_ensure_render_rect(sink, width, height))
|
||||
return FALSE;
|
||||
sink->window_width = wattr.width;
|
||||
sink->window_height = wattr.height;
|
||||
sink->window_width = width;
|
||||
sink->window_height = height;
|
||||
}
|
||||
|
||||
if (sink->window &&
|
||||
|
|
Loading…
Reference in a new issue