GNOME Bugzilla – Bug 704807
gl: Simplify windowing logic
Last modified: 2018-05-05 21:09:18 UTC
Just create offscreen surfaces if no window is required, don't have the complicated re-parenting logic (that only works on some platforms) for the windows there. And require GstVideoOverlay to be used before going to READY.
It's already implemented on egl. See eglCreatePbufferSurface (or EGL_KHR_surfaceless_context) in gstglcontext_egl.c. So we need to do the same thing on glx, wgl and cocoa. Well almost everything on egl except the fact that we could accept a NULL window. As done here: https://bug704809.bugzilla-attachments.gnome.org/attachment.cgi?id=265481
The code is there but is not triggered, I think. At least for the dispmanx/egl backend. From what I can see here, in gstglwindow_dispmanx_egl.c a native window is created and get_window_handle() returns a non-null result. So in gstglcontext_egl and EGLSurface is created for the handle and the other branch (surfaceless context) is not triggered. The use-case I have in mind is to use glimagesink::client-draw within WebKit. For that I don't think I need the gstglwindow_dispmanx to create a native window because it's handled by WebKit instead. I'm not sure how it's all supposed to work but shouldn't the native window support be optional, in the Dispmanx and perhaps Android/EGL cases?
Philippe there are 2 options: 1: implement gst_gl_window_dispmanx_show because currently it is visible even if glimagesink does not call gst_gl_window_show. 2: Try with GST_GL_WINDOW=none ? (none or whatever name different than dispmanx, x11, cocoa, wayland, win32, eagl) It will use gst_gl_dummy_window_new internally. But not sure if it will work if the contexts shared ressources because the need of having same display. You make me realize that if "egl && glimagesink->other_context && "client-draw" connected", then glimagesink can use the dummy window instead of creating an unvisible one. (We can apply same logic for other GST_GL_PLATFORM when support will be there)
My dispmanx issues were fixed in bug 746632 :)
So here we need to do same as http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/egl/gstglcontext_egl.c#n386 Adding support for glXCreatePbuffer would be great.
Not going to be implemented as adding glimagesink to an already running pipeline would break very badly then.