GNOME Bugzilla – Bug 767699
vaapisink: don't reply raw caps if no VA display
Last modified: 2016-06-16 11:35:29 UTC
This pipeline fails $ gst-launch-1.0 filesrc location= ~/patterns/517748282_4.mp4 ! decodebin ! autovideosink The output is: Setting pipeline to PAUSED ... Pipeline is PREROLLING ... libva info: VA-API version 0.39.2 libva info: va_getDriverName() returns 0 libva info: Trying to open /opt/gnome/jh/lib/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_0_39 libva info: va_openDriver() returns 0 Got context from element 'vaapidecode': gst.vaapi.Display=context, gst.vaapi.Display=(GstVaapiDisplay)NULL; Redistribute latency... WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Delayed linking failed. Additional debug info: ./grammar.y(506): void gst_parse_no_more_pads(GstElement *, gpointer) (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0: failed delayed linking some pad of GstDecodeBin named decodebin0 to some pad of GstAutoVideoSink named autovideosink0 ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: GStreamer encountered a general stream error. Additional debug info: qtdemux.c(5766): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0: streaming stopped, reason not-linked ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ... Nonetheless, in branch 1.8 is working.
This is the result of my bisect: * fd04a7c (refs/bisect/bad) gst/vaapi: keep precedence for NV12 over I420 * 75a20de (HEAD, refs/bisect/good-75a20deab46a40442b64d53218f37825647401fb) vaapidecode: Use video format derived from decoded surface as default src pad format
Two problems here: 1\ Autovideosink chooses first vaapisink, but it ditches it because the caps template of vaapisink doesn't match with video/x-raw (!!!!) 2\ Autovideosink then chooses, in my setup, ximagesink, but it cannot be linked because decodebin (with vaapi) set the src caps as video/x-raw(memory:VASurface), format=NV12 which is not handled by ximagesink Workarounds: gst-launch-1.0 filesrc location=example.mp4 ! decodebin ! {videoconvert,vaapipostproc} ! autovideosink gst-launch-1.0 filesrc location=example.mp4 ! decodebin ! autovideosink filter-caps="video/x-raw\(memory:VASurface\)" First we have to know why the vaapisink caps template doesn't match with video/x-raw
Created attachment 329871 [details] [review] vaapisink: return caps template if no display If vaapisink received a caps query before getting a VA display, it returned only the surfaces related caps. This behavior broke the autovideosink negotiation. This patch returns the pad's template caps if no VA display, otherwise the caps are crafted as before.
Attachment 329871 [details] pushed as aee9166 - vaapisink: return caps template if no display
also backported to branch 1.8