From 3fcea0dc5ec19f76814242ce97b78ef59e85e237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 27 Sep 2012 14:08:22 +0200 Subject: [PATCH] eglglessink: Update surface dimensions on every buffer --- ext/eglgles/gsteglglessink.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/ext/eglgles/gsteglglessink.c b/ext/eglgles/gsteglglessink.c index 52ae4e43c6..6dad02069c 100644 --- a/ext/eglgles/gsteglglessink.c +++ b/ext/eglgles/gsteglglessink.c @@ -1384,6 +1384,22 @@ HANDLE_ERROR_LOCKED: return FALSE; } +static void +gst_eglglessink_update_surface_dimensions (GstEglGlesSink * eglglessink) +{ + /* Save surface dims */ + eglQuerySurface (eglglessink->eglglesctx->display, + eglglessink->eglglesctx->surface, EGL_WIDTH, + &eglglessink->eglglesctx->surface_width); + eglQuerySurface (eglglessink->eglglesctx->display, + eglglessink->eglglesctx->surface, EGL_HEIGHT, + &eglglessink->eglglesctx->surface_height); + + GST_INFO_OBJECT (eglglessink, "Got surface of %dx%d pixels", + eglglessink->eglglesctx->surface_width, + eglglessink->eglglesctx->surface_height); +} + static gboolean gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink) { @@ -1417,16 +1433,7 @@ gst_eglglessink_init_egl_surface (GstEglGlesSink * eglglessink) } /* Save surface dims */ - eglQuerySurface (eglglessink->eglglesctx->display, - eglglessink->eglglesctx->surface, EGL_WIDTH, - &eglglessink->eglglesctx->surface_width); - eglQuerySurface (eglglessink->eglglesctx->display, - eglglessink->eglglesctx->surface, EGL_HEIGHT, - &eglglessink->eglglesctx->surface_height); - - GST_INFO_OBJECT (eglglessink, "Got surface of %dx%d pixels", - eglglessink->eglglesctx->surface_width, - eglglessink->eglglesctx->surface_height); + gst_eglglessink_update_surface_dimensions (eglglessink); /* We have a surface! */ eglglessink->have_surface = TRUE; @@ -2002,6 +2009,9 @@ gst_eglglessink_render_and_display (GstEglGlesSink * eglglessink, goto HANDLE_ERROR; } + /* Update surface dims */ + gst_eglglessink_update_surface_dimensions (eglglessink); + /* If no one has set a display rectangle on us initialize * a sane default. According to the docs on the xOverlay * interface we are supposed to fill the overlay 100%