wpe: Properly respect LIBGL_ALWAYS_SOFTWARE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2252>
This commit is contained in:
Thibault Saunier 2021-04-21 23:14:13 -04:00 committed by GStreamer Marge Bot
parent 4dbfae0105
commit 9415106b02

View file

@ -393,21 +393,23 @@ WPEView::WPEView(WebKitWebContext* web_context, GstWpeVideoSrc* src, GstGLContex
threading.ready = FALSE; threading.ready = FALSE;
g_mutex_init(&images_mutex); g_mutex_init(&images_mutex);
if (context) if (g_strcmp0(g_getenv("LIBGL_ALWAYS_SOFTWARE"), "true")) {
gst.context = GST_GL_CONTEXT(gst_object_ref(context)); if (context)
if (display) { gst.context = GST_GL_CONTEXT(gst_object_ref(context));
gst.display = GST_GL_DISPLAY(gst_object_ref(display)); if (display) {
} gst.display = GST_GL_DISPLAY(gst_object_ref(display));
}
wpe.width = width; wpe.width = width;
wpe.height = height; wpe.height = height;
if (context && display) { if (context && display) {
if (gst_gl_context_get_gl_platform(context) == GST_GL_PLATFORM_EGL) { if (gst_gl_context_get_gl_platform(context) == GST_GL_PLATFORM_EGL) {
gst.display_egl = gst_gl_display_egl_from_gl_display (gst.display); gst.display_egl = gst_gl_display_egl_from_gl_display (gst.display);
} else { } else {
GST_DEBUG ("Available GStreamer GL Context is not EGL - not creating an EGL display from it"); GST_DEBUG ("Available GStreamer GL Context is not EGL - not creating an EGL display from it");
} }
}
} }
if (gst.display_egl) { if (gst.display_egl) {