summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChun-wei Fan <fanchunwei@src.gnome.org>2021-01-05 14:30:08 +0800
committerChun-wei Fan <fanchunwei@src.gnome.org>2021-01-05 14:34:06 +0800
commit397a71ca8bfbe92352b40f113b427477430d2521 (patch)
treea098ae50968758dcd032116efa05d2b3fd564a07
parentfb31581bb4766020bc6beeadf47bcc4b51b45baf (diff)
downloadgtk+-no-gl-context.tar.gz
gstreamer media backend: Disable OpenGL on Windowsno-gl-context
...for at least WGL, since we are not allowed to use wglMakeCurrent(), which is eventually called by gdk_gl_context_make_current() to share WGL contexts across different threads, which will cause a crash. This means, we cannot enable WGL in the gstreamer media backend on Windows.
-rw-r--r--modules/media/gtkgstpaintable.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/media/gtkgstpaintable.c b/modules/media/gtkgstpaintable.c
index 470a5f59e4..5bd789c1f3 100644
--- a/modules/media/gtkgstpaintable.c
+++ b/modules/media/gtkgstpaintable.c
@@ -118,6 +118,18 @@ gtk_gst_paintable_video_renderer_create_video_sink (GstPlayerVideoRenderer *rend
GtkGstPaintable *self = GTK_GST_PAINTABLE (renderer);
GstElement *sink, *glsinkbin;
+#if GST_GL_HAVE_WINDOW_WIN32 && GST_GL_HAVE_PLATFORM_WGL && defined (GDK_WINDOWING_WIN32)
+ /*
+ * Unfortunately, we can't connect the GstGLContext with our GDKGLContext,
+ * since gdk_gl_context_make_current(), which calls wglMakeCurrent(), does not
+ * allow us to share WGL contexts across threads, which will cause a crash.
+ * See MR !3034, so no WGL in the gstreamer media backend :(
+ */
+ sink = g_object_new (GTK_TYPE_GST_SINK,
+ "paintable", self,
+ NULL);
+ return sink;
+#else
sink = g_object_new (GTK_TYPE_GST_SINK,
"paintable", self,
"gl-context", self->context,
@@ -131,6 +143,7 @@ gtk_gst_paintable_video_renderer_create_video_sink (GstPlayerVideoRenderer *rend
g_object_set (glsinkbin, "sink", sink, NULL);
return glsinkbin;
+#endif
}
static void