From c537b2e2bb9f553b59cfd209b15e9d4ff2d27cdb Mon Sep 17 00:00:00 2001 From: Yuji Kuwabara Date: Thu, 21 Sep 2017 14:03:28 +0900 Subject: [PATCH] gl/dispmanx: fix removing foreign window handle gst_gl_window_dispmanx_egl_set_window_handle() removes native window handle (dispmanx element), regardless it was foreign window handle (set via gst_video_overlay_set_window_handle()) or not. This problem prevents glimagesink reusable. (PAUSED -> READY -> PAUSED does not work) This patch corrects it comparing the native window handle with foreign window handle. This behavior is same as gst_gl_window_dispmanx_egl_close(). https://bugzilla.gnome.org/show_bug.cgi?id=785199 --- gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c index 7b10b4d016..46bd509e36 100644 --- a/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c +++ b/gst-libs/gst/gl/dispmanx/gstglwindow_dispmanx_egl.c @@ -192,7 +192,7 @@ gst_gl_window_dispmanx_egl_set_window_handle (GstGLWindow * window, GST_DEBUG_OBJECT (window, "set window handle with size %dx%d", foreign_window->width, foreign_window->height); - if (window_egl->native.element) { + if (window_egl->native.element && window_egl->native.element != window_egl->foreign.element) { dispman_update = vc_dispmanx_update_start (0); vc_dispmanx_element_remove (dispman_update, window_egl->native.element); vc_dispmanx_update_submit_sync (dispman_update);