dispmanx origin isn't updated with window_resize
Issue introduced by the resolution of #849 (closed). When the render rectangle is called with glimagesink render-rectangle="<230,230,640,480>"
, the origin of the render rectangle isn't adjusted but remains in the center of the screen.
This is due to the following snippet:
static void
_set_render_rectangle (gpointer data)
{
struct SetRenderRectangle *render = 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;
}
By setting the render_rect
after calling window_resize, the resize defaults to the dp_width and dp_height to determine the x
and y
value of the render rectangle origin. However, it should be determined by the render rectangle. Since, during execution of window_resize
the render_rect
is missing it wrongly evaluates the following:
/* If there is no render rectangle, center the width*height frame
* inside dp_width*dp_height */
if (window_egl->render_rect.w <= 0 || window_egl->render_rect.h <= 0) {
GstVideoRectangle dst;
dst.w = window_egl->dp_width;
dst.h = window_egl->dp_height;
dst.x = dst.y = 0;
gst_video_sink_center_rect (src, dst, &res, FALSE);
} else {
gst_video_sink_center_rect (src, window_egl->render_rect, &res, FALSE);
}
which causes the unchanged origin.
Assigning the render rectangle before calling window_resize
fixes the issue.