glcontext: add support for influencing the backing configuration
authorMatthew Waters <matthew@centricular.com>
Tue, 8 Sep 2020 06:27:03 +0000 (16:27 +1000)
committerMatthew Waters <matthew@centricular.com>
Thu, 13 May 2021 06:44:28 +0000 (16:44 +1000)
commit7066c849e4123166854bb84eb1fd69e38646400b
treed1445923d4d5a389cda0c965a7fe53e487afc28d
parentdfd749c5da38d067d7ec899f74eb9a42b3c7ec2b
glcontext: add support for influencing the backing configuration

New API:
- gst_gl_context_get_config()
- gst_gl_context_request_config()

A GL context configuration is a GstStructure that has some well-known
names for common values that can also be extended in platform-specific
ways if necessary.

Wrapped OpenGL contexts may be able to retrieve the GL context
configuration depending on the platform.  If that information is
available, GstGLContext will attempt to create an context that matches
the shared OpenGL context config unless gst_gl_context_request_config()
has been called.

A new environment variable 'GST_GL_CONFIG' will be read to influence the
configuration chosen.  The environment variable will only be used as a
fallback if gst_gl_context_request_config() has not been called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/809>
14 files changed:
gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m
gst-libs/gst/gl/eagl/gstglcontext_eagl.m
gst-libs/gst/gl/egl/gstglcontext_egl.c
gst-libs/gst/gl/egl/gstglcontext_egl.h
gst-libs/gst/gl/gl.h
gst-libs/gst/gl/gstglcontext.c
gst-libs/gst/gl/gstglcontext.h
gst-libs/gst/gl/gstglcontext_private.h
gst-libs/gst/gl/gstglcontextconfig.c [new file with mode: 0644]
gst-libs/gst/gl/gstglcontextconfig.h [new file with mode: 0644]
gst-libs/gst/gl/meson.build
gst-libs/gst/gl/wgl/gstglcontext_wgl.c
gst-libs/gst/gl/x11/gstglcontext_glx.c
gst-libs/gst/gl/x11/gstglcontext_glx.h