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
This commit is contained in:
Yuji Kuwabara 2017-09-21 14:03:28 +09:00 committed by Matthew Waters
parent 090bbd0721
commit c537b2e2bb

View file

@ -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", GST_DEBUG_OBJECT (window, "set window handle with size %dx%d",
foreign_window->width, foreign_window->height); 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); dispman_update = vc_dispmanx_update_start (0);
vc_dispmanx_element_remove (dispman_update, window_egl->native.element); vc_dispmanx_element_remove (dispman_update, window_egl->native.element);
vc_dispmanx_update_submit_sync (dispman_update); vc_dispmanx_update_submit_sync (dispman_update);