glimagesink error `!xcb_xlib_threads_sequence_lost' failed.
- For each video item in a list, the app:
- 1) creates a new pipeline "playbin video-sink=glimagesink"
- 2) at end of video item cleans pipeline
- The main() function calls XInitThread() right at its beginning.
- The app renders in its own GLX window using libglfw (receiving samples/textures from glimagesink's client-draw callback). The application context is shared with each pipeline through bus sync-message (GST_MESSAGE_NEED_CONTEXT)
- Often the app aborts with X11 assertion:
- [xcb] Unknown sequence number while processing queue
- [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
- [xcb] Aborting, sorry about that.
- info-beamer: ../../src/xcb_io.c:274: poll_for_event: Assertion `!xcb_xlib_threads_sequence_lost' failed.
- The error can happen from :
- - gst_gl_context_create_thread / gst_gl_context_glx_create_context / glXCreateContextAttribsARB
- - libglfw.so.3 / XPending
- Application's X11 display/context is used to create a GstGLcontext/GstGLDisplay for every item/pipeline. (Or should this be done only once in the beginning of main?)
- x11_display = glXGetCurrentDisplay();
- x11_window = (Window) glXGetCurrentDrawable();
- glx_context = glXGetCurrentContext ();
- platform = "glx";
- gl_display =
- (GstGLDisplay *) gst_gl_display_x11_new_with_display (x11_display);
- gl_context =
- gst_gl_context_new_wrapped (gl_display, (guintptr) glx_context,
- gst_gl_platform_from_string (platform),
- gl_display, gl_context are used in sync-message bus callback to share display and context with pipeline.