gstgl doesn't undo/overwrite what GL state the examples are changing
anymore. As such, the examples need to reset the GL state themselves
to be able to play nice with libgstgl
We need to pass the X11 display to GstGL or else it will
use its own X11 Display pointer, and the GL Context won't get shared
correctly on newer X servers
1. glcontextid function is replaced by gstreamer gst_gl_context_new_wrapped .
2. call gst_init before gst_gl_display_new , seems gst_gl_display_new depends
on gst_allocator_register , which only worked after gst_init called
3. flush gstreamer OpenGL context before using shared texture, fix
flicker problem.
https://bugzilla.gnome.org/show_bug.cgi?id=735566
Before:
GST_GL_PLATFORM=cocoa GST_GL_WINDOW=cocoa
gst-launch-1.0 videotestsrc ! glimagesink
After:
GST_GL_PLATFORM=cgl GST_GL_WINDOW=cocoa
gst-launch-1.0 videotestsrc ! glimagesink
but still pass --enable-cocoa to configure script
because currently it can only be used with cocoa API.
We could later have cgl/gstglcontext_cgl.h that manages
a CGLContextObj directly and cocoa/gstglcontext_cocoa.h
would just wrap it.
So that it could be used with other Apple's window APIs.
https://bugzilla.gnome.org/show_bug.cgi?id=729245