mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
eglglessink: Update surface dimensions on every buffer
This commit is contained in:
parent
2b2ae0fd6f
commit
3fcea0dc5e
1 changed files with 20 additions and 10 deletions
|
@ -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%
|
||||
|
|
Loading…
Reference in a new issue