GNOME Bugzilla – Bug 758629
glimagesink: plugin doesn't step aside with no or invalid DISPLAY
Last modified: 2015-11-26 03:10:56 UTC
For Cygwin, I have the following video sinks of at least GST_RANK_MARGINAL: ximagesink (Rank: secondary) glimagesink (GLX, Rank: secondary) d3dvideosink (PATCHED FOR Rank: marginal) I patched the rank of d3dvideosink so that the X11-based sinks take priority when DISPLAY is set, as only they can be embedded in an X window, but d3dvideosink can still be used to show videos automatically when DISPLAY is unset. This arrangement works well when only ximagesink and d3dvideosink are installed: $ GST_DEBUG=playbin:4 DISPLAY= gst-launch-1.0 playbin uri=file:///path/to/video Setting pipeline to PAUSED ... Pipeline is PREROLLING ... 0:00:00.170399553 9092 0x6005210f0 WARN playbin gstplaybin2.c:4643:autoplug_select_cb:<playbin0> Could not activate sink ximagesink Redistribute latency... 0:00:00.234448936 9092 0x6005658f0 INFO playbin gstplaybin2.c:3742:no_more_pads_cb:<playbin0> setting custom audio sink <pulsesink0> 0:00:00.234535341 9092 0x6005658f0 INFO playbin gstplaybin2.c:3749:no_more_pads_cb:<playbin0> setting custom video sink <d3dvideosink0> Pipeline is PREROLLED ... Setting pipeline to PLAYING ... [snip] This is exactly what I would expect; without DISPLAY, the ximagesink should fail, and allow another video sink to be chosen. The same occurs (albeit seemingly slower) if DISPLAY is set to an address/socket on which an X server is not running, so this must be checked with XOpenDisplay(). However, if the opengl plugin from bad 1.6.1 is installed: $ GST_DEBUG=playbin:4 DISPLAY= gst-launch-1.0 playbin uri=file:///path/to/video Setting pipeline to PAUSED ... Pipeline is PREROLLING ... Got context from element 'sink': gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"\(GstGLDisplayX11\)\ gldisplayx11-0"; Redistribute latency... 0:00:00.464773214 9924 0x6006dd320 INFO playbin gstplaybin2.c:3742:no_more_pads_cb:<playbin0> setting custom audio sink <pulsesink0> 0:00:00.464874246 9924 0x6006dd320 INFO playbin gstplaybin2.c:3749:no_more_pads_cb:<playbin0> setting custom video sink <glimagesinkbin0> ERROR: from element /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink: Failed to connect to X display server Additional debug info: /usr/src/ports/gstreamer1.0-plugins-bad-free/gstreamer1.0-plugins-bad-free-1.6.1-1.x86_64/src/gst-plugins-bad-1.6.1/ext/gl/gstglimagesink.c(819): _ensure_gl_setup (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstGLImageSinkBin:glimagesinkbin0/GstGLImageSink:sink ERROR: pipeline doesn't want to preroll. [snip] It would appear that glimagesink (with GLX) isn't checking whether it can connect to DISPLAY on initialization, only to fail later on. I believe it should check as ximagesink does.
I believe this is already fixed in git master with the winsys/GL setup being moved down to NULL_TO_READY (from READY_TO_PAUSED).
(In reply to Matthew Waters from comment #1) > I believe this is already fixed in git master with the winsys/GL setup being > moved down to NULL_TO_READY (from READY_TO_PAUSED). You are correct, commit 70be81a fixes this issue. Thanks!