Hi Petros, thanks for taking some time to help me!
I tried to build GStreamer from source, using the master branch, because after several gdb sessions, it’s pretty clear that the current version of GStreamer that is distributed via APT (version 1.10.5) is not compiled with GLES2 support.
I tried with several build scripts, including yours, but all have failed. Apparently, one cannot build GStreamer 1.15 with the current state of dependencies distributed by APT.
Yet, I made some progress today!
I found the gst-build repo on Github: https://github.com/GStreamer/gst-build
From it, it’s pretty easy to build the version 1.10 of GStreamer with some support of GLES2 (get the 1.10 branch of gst-build)? (I know 1.10 is old, but as it matches the current version on raspbian, the dependencies all well set up)
Using this custom build, I managed to go further in the shared context creation…
The context creation (in gst_gl_context_create_thread from https://github.com/GStreamer/gst-plugins-bad/blob/1.10/gst-libs/gst/gl/gstglcontext.c) still fails, because for some other reason, glGetString(GL_VERSION) fails in gst_gl_context_fill_info.
I wonder what caused that mess, and if I’m the only one suffering from this. (I started from a fresh Raspbian Stretch install) Older messages about GStreamer and RPi suggest it worked at some point…