gl/dispmanx: assign render_rect to window before window_resize
authorAlexander Vandenbulcke <av@telecom-it.be>
Mon, 1 Mar 2021 11:23:25 +0000 (12:23 +0100)
committerAlexander Vandenbulcke <av@telecom-it.be>
Tue, 2 Mar 2021 08:13:25 +0000 (09:13 +0100)
If the `render_rect` for a dispmanx display is set after calling
`window_resize` the resize defaults to the dp_width and dp_height to
determine the location of the render rectangle instead of the correct
dimensions that should be set on the window_egl.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1056>

gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c

index 094888e..c1e2d71 100644 (file)
@@ -310,9 +310,8 @@ _set_render_rectangle (gpointer data)
   GST_LOG_OBJECT (render->window_egl, "setting render rectangle %i,%i+%ix%i",
       render->rect.x, render->rect.y, render->rect.w, render->rect.h);
 
-  window_resize (render->window_egl, render->rect.w, render->rect.h, TRUE);
-
   render->window_egl->render_rect = render->rect;
+  window_resize (render->window_egl, render->rect.w, render->rect.h, TRUE);
 }
 
 static gboolean