After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 750308 - Extract GstGLSurface and GstGLMessageLoop from GstGLWindow
Extract GstGLSurface and GstGLMessageLoop from GstGLWindow
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-06-02 22:53 UTC by Julien Isorce
Modified: 2018-05-05 21:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Julien Isorce 2015-06-02 22:53:19 UTC
I would like to start discussion about refactoring GstGLWindow.

Currently our offscreen surface support is handled through a GstGLWindow. For example when an upstream element (or the app) provides a gl context (i.e.: ->other_context) then the GstGLWindowX11 is "->open" but not created (http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/egl/gstglcontext_egl.c#n392). It is confusing.

We could have GstGLWindow and a new GstGLOffScreenSurface deriving from a new GstGLSurface.

Except for egl we currently do not have implementation for offscreen surface with glx or cgl (It could be done through PBufferSurface) So currently these surfaces are hidden windows.

So either we implement these 2 missing bits or we can also simply have a GstGLSurface being offscreen in its default implementation. Then GstGLWindow_X11 will override "->is_offscreen()" and "->create".

Also for the current GstGLWindow's GMainContext/GMainLoop (for gl thread) we should probably have a new object GstGLMessageLoop. A GstGLContext will own a GstGLMessageLoop (or name it as GstGLThread).
This change will allow us to handle offscreen surface properly.

(Note that http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c5f8c789a3b87c01529b9298c1940e2b08fe4c66 can be done for all other backend: win32, wayland, dispmanx, cocoa)

GstGLWindow will own the navigation_GThread/_GMainContext/_GMainLoop.

GstGLWindow_X11/_Win32/_Cocoa/.. will create the window, attach a GSource, qnd implement GstVideoOverlay (i.e. set_window_handle / navigation)

In glimagesink, the call to gst_gl_window_draw will be replaced by a new function gst_gl_surface_draw.

gst_gl_context_thread_add will be replaced by a new gst_gl_message_loop_invoke.
Comment 1 Matthew Waters (ystreet00) 2016-11-10 14:56:04 UTC
While this is a nice idea, it's a lot of code churn for very little gain in something that's not really user-facing API.  There are only so many platforms that we can support.

There's one problem though and that is that the OSX/iOS parts don't use GMainLoop anymore instead relying on GCD for their function marshalling.

Unless you or someone else is going to work on this, then this isn't going to happen anytime soon.
Comment 2 Matthew Waters (ystreet00) 2018-05-05 21:07:18 UTC
Not really going to be implemented.