mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-10 03:19:40 +00:00
eglglessink: GlViewPort() should use actual surface size
This commit is contained in:
parent
f707961183
commit
391137a20e
2 changed files with 13 additions and 1 deletions
|
@ -1183,6 +1183,15 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
|
||||||
goto HANDLE_EGL_ERROR_LOCKED;
|
goto HANDLE_EGL_ERROR_LOCKED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Save surface dims */
|
||||||
|
eglQuerySurface (eglglessink->display, eglglessink->surface, EGL_WIDTH,
|
||||||
|
&eglglessink->surface_width);
|
||||||
|
eglQuerySurface (eglglessink->display, eglglessink->surface, EGL_HEIGHT,
|
||||||
|
&eglglessink->surface_height);
|
||||||
|
|
||||||
|
GST_INFO_OBJECT (eglglessink, "Got surface of %dx%d pixels",
|
||||||
|
eglglessink->surface_width, eglglessink->surface_height);
|
||||||
|
|
||||||
/* We have a surface! */
|
/* We have a surface! */
|
||||||
eglglessink->have_surface = TRUE;
|
eglglessink->have_surface = TRUE;
|
||||||
g_mutex_unlock (eglglessink->flow_lock);
|
g_mutex_unlock (eglglessink->flow_lock);
|
||||||
|
@ -1509,7 +1518,8 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink,
|
||||||
* The way it is right now makes this happen only for the first buffer
|
* The way it is right now makes this happen only for the first buffer
|
||||||
* though so I guess it should work */
|
* though so I guess it should work */
|
||||||
if (gst_eglglessink_setup_vbo (eglglessink, FALSE)) {
|
if (gst_eglglessink_setup_vbo (eglglessink, FALSE)) {
|
||||||
glViewport (0, 0, w, h);
|
glViewport (0, 0, eglglessink->surface_width,
|
||||||
|
eglglessink->surface_height);
|
||||||
} else {
|
} else {
|
||||||
GST_ERROR_OBJECT (eglglessink, "VBO setup failed");
|
GST_ERROR_OBJECT (eglglessink, "VBO setup failed");
|
||||||
goto HANDLE_ERROR;
|
goto HANDLE_ERROR;
|
||||||
|
|
|
@ -159,6 +159,8 @@ struct _GstEglGlesSink
|
||||||
gboolean force_rendering_slow;
|
gboolean force_rendering_slow;
|
||||||
gint window_default_width;
|
gint window_default_width;
|
||||||
gint window_default_height;
|
gint window_default_height;
|
||||||
|
EGLint surface_width;
|
||||||
|
EGLint surface_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstEglGlesSinkClass
|
struct _GstEglGlesSinkClass
|
||||||
|
|
Loading…
Reference in a new issue