the macOS glimagesink implementation is broken in that when it is not given a video window context (so it creates one itself), the window does not close when the EOS is sent and the pipeline GST_STATE is set to NULL. Furthermore, the black empty gl window that remains unclosed causes a segfault if it is closed by clicking its close button.
- This error has been around unfixed for at least 4 years. Other people gave up, and used workarounds (unfortunately osxvideosink has a similar problem). I think it is time to fix this, and will put some effort into it, but would like some guidance.
Here are some of the the older reports
The issue can’t be demonstrated with gst-launch-1.0 because that de-initializes gstreamer when eos arrives, but I will eventually write a small demo, with a main_loop and bus messages, that remains open after eos, and then reopen as a Issue. EDIT: the earliest of the above reports has a demo:
https://gitlab.freedesktop.org/-/project/1352/uploads/ff39d4c1209ad7e130a5940cdbd50848/main.c
For our use case, it’s not practical to supply a window handle rather than let glimagesink create one itself because the macOS version of our app is a build of something that builds on linux/windows/*BSD/macOS and can use all the different gstreamer videosinks, so relies on automatic window creation, and destruction, without closing the app before creating a new window.
Right now the initial exploration is comparing GST_DEBUG=5 output differences of glimagesink between linux (working correctly) and macOS versions, and adding lots of printf statements in things like
- question for experts ( maybe @ystreet00 ): where exactly is the last place in GStreamer where the window-closing command gets (should get) sent to the macOS window manager if everything had been properly unreffed/destroyed ? (including the context) is it in:
gst_gl_context_cocoa_destroy_context (GstGLContext *context)
?
If this issue is something not being fully unref’d I could add refcount checks, but I am guessing it is a context left behind. somewhere? I’m assuming this is something fixable in gstreamer code?