eglglessink: GlViewPort() should use actual surface size

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-17 18:00:16 -03:00 committed by Sebastian Dröge
parent f707961183
commit 391137a20e
2 changed files with 13 additions and 1 deletions

View file

@ -1183,6 +1183,15 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink)
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! */
eglglessink->have_surface = TRUE;
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
* though so I guess it should work */
if (gst_eglglessink_setup_vbo (eglglessink, FALSE)) {
glViewport (0, 0, w, h);
glViewport (0, 0, eglglessink->surface_width,
eglglessink->surface_height);
} else {
GST_ERROR_OBJECT (eglglessink, "VBO setup failed");
goto HANDLE_ERROR;

View file

@ -159,6 +159,8 @@ struct _GstEglGlesSink
gboolean force_rendering_slow;
gint window_default_width;
gint window_default_height;
EGLint surface_width;
EGLint surface_height;
};
struct _GstEglGlesSinkClass