1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
From eb552ac9f5cb457de11d4da8214982de4ad35283 Mon Sep 17 00:00:00 2001
From: Haihua Hu <jared.hu@nxp.com>
Date: Mon, 11 Sep 2017 16:00:24 +0800
Subject: [PATCH 2/3] [MMFMWK-7707]gl/viv-fb: transform screen coordinate to
viewport coordinate
In y direction, screen coordinate are opposite to viewport coordinate.
Upstream-Status: Backport [1.13.1]
https://bugzilla.gnome.org/show_bug.cgi?id=787394
---
gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c b/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c
index 14d9997..e1a3fd3 100644
--- a/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c
+++ b/gst-libs/gst/gl/viv-fb/gstglwindow_viv_fb_egl.c
@@ -210,15 +210,28 @@ _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;
--
1.9.1
|