mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
gl/viv-fb: transform screen coordinate to viewport coordinate
In y direction, screen coordinate are opposite to viewport coordinate. https://bugzilla.gnome.org/show_bug.cgi?id=787394
This commit is contained in:
parent
039c983a9f
commit
b738774566
1 changed files with 15 additions and 2 deletions
|
@ -214,16 +214,29 @@ _free_set_render_rectangle (SetRenderRectangleData * render)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_calculate_viewport_coordinates(GstGLWindowVivFBEGL * window_egl,
|
||||
GstVideoRectangle * req, GstVideoRectangle * result)
|
||||
{
|
||||
result->x = req->x;
|
||||
result->y = window_egl->window_height - (req->y + req->h);
|
||||
result->w = req->w;
|
||||
result->h = req->h;
|
||||
}
|
||||
|
||||
static void
|
||||
_set_render_rectangle (gpointer data)
|
||||
{
|
||||
SetRenderRectangleData *render = data;
|
||||
GstGLWindow *window = GST_GL_WINDOW (render->window_egl);
|
||||
GstGLWindowVivFBEGL *window_egl = render->window_egl;
|
||||
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
||||
|
||||
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);
|
||||
|
||||
render->window_egl->render_rectangle = render->rect;
|
||||
_calculate_viewport_coordinates (window_egl, &render->rect,
|
||||
&window_egl->render_rectangle);
|
||||
|
||||
gst_gl_window_resize (window, render->rect.w, render->rect.h);
|
||||
|
||||
window->queue_resize = TRUE;
|
||||
|
|
Loading…
Reference in a new issue