This is too allow gst-launch debugging with multiple GL contexts as
well as avoiding segfaulting innocent gtk+ apps that have not called
XInitThreads.
https://bugzilla.gnome.org/show_bug.cgi?id=731525
#include <bcm_host.h>
#endif
+#if GST_GL_HAVE_WINDOW_X11
+#include <X11/Xlib.h>
+#endif
+
#define GST_CAT_DEFAULT gst_gl_gstgl_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
bcm_host_init ();
#endif
+#if GST_GL_HAVE_WINDOW_X11
+ if (g_getenv ("GST_GL_XINITTHREADS"))
+ XInitThreads ();
+#endif
+
if (!gst_element_register (plugin, "glimagesink",
GST_RANK_SECONDARY, GST_TYPE_GLIMAGE_SINK)) {
return FALSE;