After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 749554 - ERROR: pipeline doesn't want to preroll using gstreamer-1.4
ERROR: pipeline doesn't want to preroll using gstreamer-1.4
Status: RESOLVED FIXED
Product: gstreamer-vaapi
Classification: Other
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gstreamer-vaapi maintainer(s)
gstreamer-vaapi maintainer(s)
Depends on:
Blocks: 727841 743569
 
 
Reported: 2015-05-18 17:51 UTC by Julian Sikorski
Modified: 2015-08-13 15:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
workaround: enable vaapidecodebin only for gstreamer-1.5 (881 bytes, patch)
2015-05-27 19:34 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapipostproc: return NULL caps if no filter available (1.39 KB, patch)
2015-06-26 11:31 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecodebin: enable vpp if it is available (9.48 KB, patch)
2015-07-01 12:50 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecodebin: notify if vpp is disabled (4.60 KB, patch)
2015-07-01 12:50 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecodebin: use constructed() to configure bin (5.15 KB, patch)
2015-07-06 18:53 UTC, Víctor Manuel Jáquez Leal
needs-work Details | Review
vaapidecodebin: use pad templates in ghost pads (2.44 KB, patch)
2015-07-06 18:53 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecodebin: post an error message if fails (1.08 KB, patch)
2015-07-06 18:53 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecodebin: add postprocessor dynamically (8.92 KB, patch)
2015-07-06 18:53 UTC, Víctor Manuel Jáquez Leal
rejected Details | Review
vaapidecodebin: check for postproc instance (1.42 KB, patch)
2015-07-06 18:53 UTC, Víctor Manuel Jáquez Leal
none Details | Review
vaapidecodebin: remove postproc dynamically (3.82 KB, patch)
2015-07-06 18:54 UTC, Víctor Manuel Jáquez Leal
rejected Details | Review
pipeline_graph (344.95 KB, image/png)
2015-07-07 11:37 UTC, sreerenj
  Details
vaapidecodebin: has_vpp as a tri-state variable (2.78 KB, patch)
2015-08-06 17:26 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecodebin: post an error message if fails (1.08 KB, patch)
2015-08-06 17:26 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecodebin: ensure VPP before going to READY (4.45 KB, patch)
2015-08-06 17:26 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecodebin: check for postproc instance (1.71 KB, patch)
2015-08-06 17:26 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Julian Sikorski 2015-05-18 17:51:47 UTC
Hello,

I just updated to git master (70eff01d) in order to check the status of bug 743687. Unfortunately, it is not possible to play anything:

$ LANG=C gst-launch-1.0 -v playbin uri=xxx 
Setting pipeline to PAUSED ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: ring-buffer-max-size = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-size = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: buffer-duration = -1
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: use-buffering = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: download = false
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: uri = xxx
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: connection-speed = 0
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: source = "\(GstFileSrc\)\ source"
Pipeline is PREROLLING ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "video/mpegts\,\ systemstream\=\(boolean\)true\,\ packetsize\=\(int\)188"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.GstPad:src: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = audio/x-ac3
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = audio/x-ac3
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstAc3Parse:ac3parse0.GstPad:sink: caps = audio/x-ac3
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstAc3Parse:ac3parse0.GstPad:src: caps = "audio/x-ac3\,\ framed\=\(boolean\)true\,\ rate\=\(int\)48000\,\ channels\=\(int\)2\,\ alignment\=\(string\)frame"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = "video/mpeg\,\ mpegversion\=\(int\)2\,\ systemstream\=\(boolean\)false"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = "video/mpeg\,\ mpegversion\=\(int\)2\,\ systemstream\=\(boolean\)false"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:sink: caps = "video/mpeg\,\ mpegversion\=\(int\)2\,\ systemstream\=\(boolean\)false"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstCapsFilter:capsfilter0.GstPad:src: caps = "audio/x-ac3\,\ framed\=\(boolean\)true\,\ rate\=\(int\)48000\,\ channels\=\(int\)2\,\ alignment\=\(string\)frame"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstA52Dec:a52dec0.GstPad:sink: caps = "audio/x-ac3\,\ framed\=\(boolean\)true\,\ rate\=\(int\)48000\,\ channels\=\(int\)2\,\ alignment\=\(string\)frame"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "audio/x-ac3\,\ framed\=\(boolean\)true\,\ rate\=\(int\)48000\,\ channels\=\(int\)2\,\ alignment\=\(string\)frame"
libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_36
libva info: va_openDriver() returns 0
Got context from element 'vaapidecode': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstA52Dec:a52dec0.GstPad:src: caps = "audio/x-raw\,\ format\=\(string\)F32LE\,\ layout\=\(string\)interleaved\,\ rate\=\(int\)48000\,\ channels\=\(int\)2\,\ channel-mask\=\(bitmask\)0x0000000000000003"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:src: caps = "video/mpeg\,\ mpegversion\=\(int\)2\,\ systemstream\=\(boolean\)false\,\ parsed\=\(boolean\)true\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30000/1001\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ codec_data\=\(buffer\)000001b3780438345eba2f40000001b5144200010000\,\ profile\=\(string\)main\,\ level\=\(string\)high\,\ interlace-mode\=\(string\)mixed"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "video/mpeg\,\ mpegversion\=\(int\)2\,\ systemstream\=\(boolean\)false\,\ parsed\=\(boolean\)true\,\ width\=\(int\)1920\,\ height\=\(int\)1080\,\ framerate\=\(fraction\)30000/1001\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ codec_data\=\(buffer\)000001b3780438345eba2f40000001b5144200010000\,\ profile\=\(string\)main\,\ level\=\(string\)high\,\ interlace-mode\=\(string\)mixed"
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0: Internal data stream error.
Additional debug info:
mpegtsbase.c(1358): mpegts_base_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstVaapiDecode:vaapidecode0.GstPad:sink: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:src: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMpegvParse:mpegvparse0.GstPad:sink: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstA52Dec:a52dec0.GstPad:src: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstA52Dec:a52dec0.GstPad:sink: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstCapsFilter:capsfilter0.GstPad:src: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstAc3Parse:ac3parse0.GstPad:src: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstAc3Parse:ac3parse0.GstPad:sink: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:src_0: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:src_1: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_0: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstMultiQueue:multiqueue0.GstPad:sink_1: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0.GstPad:audio_0024: caps = "NULL"
/GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstTSDemux:tsdemux0.GstPad:video_0021: caps = "NULL"
Freeing pipeline ...

It was working with an earlier snapshot (3d8e5e5).
Comment 1 Víctor Manuel Jáquez Leal 2015-05-19 08:22:52 UTC
(In reply to Julian Sikorski from comment #0)
> Hello,
> 
> I just updated to git master (70eff01d) in order to check the status of bug
> 743687. Unfortunately, it is not possible to play anything:

That's odd. Which version of GStreamer are you using? 

Right now, using current master of GStreamer 1.5.0 (GIT), I'm able to run these pipelines:

gst-launch-1.0 playbin uri=http://samples.mplayerhq.hu/MPEG2/Futurama1-tmp.avi

gst-launch-1.0 playbin uri=http://samples.mplayerhq.hu/MPEG2/resolutionchange.mpg

Could you post a debug log with --gst-debug="vaapidecode:5,vaapipostproc:5,*:3"
Comment 2 Julian Sikorski 2015-05-21 20:58:13 UTC
It's with 1.4.5:

$ rpm -qa | grep gstreamer1 | sort
gstreamer1-1.4.5-1.fc21.i686
gstreamer1-1.4.5-1.fc21.x86_64
gstreamer1-debuginfo-1.4.5-1.fc21.x86_64
gstreamer1-devel-1.4.5-1.fc21.x86_64
gstreamer1-libav-1.4.3-1.fc21.x86_64
gstreamer1-plugins-bad-free-1.4.5-2.fc21.x86_64
gstreamer1-plugins-bad-freeworld-1.4.3-1.fc21.x86_64
gstreamer1-plugins-base-1.4.5-1.fc21.i686
gstreamer1-plugins-base-1.4.5-1.fc21.x86_64
gstreamer1-plugins-base-debuginfo-1.4.5-1.fc21.x86_64
gstreamer1-plugins-base-devel-1.4.5-1.fc21.x86_64
gstreamer1-plugins-good-1.4.5-2.fc21.x86_64
gstreamer1-plugins-ugly-1.4.3-1.fc21.x86_64
gstreamer1-vaapi-0.5.11.pre1-0.2.fc21.x86_64
libnice-gstreamer1-0.1.7-1.fc21.x86_64

$ LANG=C gst-launch-1.0 --gst-debug="vaapidecode:5,vaapipostproc:5,*:3"  playbin uri=http://samples.mplayerhq.hu/MPEG2/Futurama1-tmp.avi
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
0:00:00.312314626 32373 0x7f031c0ec8a0 WARN                    alsa conf.c:4705:snd_config_expand: alsalib error: Unknown parameters {AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
0:00:00.312377310 32373 0x7f031c0ec8a0 WARN                    alsa pcm.c:2239:snd_pcm_open_noupdate: alsalib error: Unknown PCM default:{AES0 0x02 AES1 0x82 AES2 0x00 AES3 0x02}
libva info: VA-API version 0.36.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_0_36
libva info: va_openDriver() returns 0
Got context from element 'vaapidecode': gst.vaapi.Display=context, display=(GstVaapiDisplay)NULL;
0:00:00.400680060 32373 0x7f031c0daf70 WARN                GST_PADS gstpad.c:1058:gst_pad_set_active:<vaapipostproc:sink> Failed to activate pad
0:00:00.400723078 32373 0x7f031c0daf70 WARN               decodebin gstdecodebin2.c:2218:connect_pad:<decodebin0> Couldn't set vaapidecodebin0 to PAUSED
0:00:00.401140736 32373 0x7f031c0daf70 ERROR              decodebin gstdecodebin2.c:1503:analyze_new_pad:<decodebin0> New pad in a chain that is already complete
0:00:00.401654310 32373 0x7f031c0daf70 ERROR            vaapidecode gstvaapidecode.c:443:gst_vaapidecode_handle_frame:<vaapidecode0> not negotiated
0:00:00.422443898 32373      0x2313630 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<source> error: Internal data flow error.
0:00:00.422487308 32373      0x2313630 WARN                 basesrc gstbasesrc.c:2933:gst_base_src_loop:<source> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstSoupHTTPSrc:source:
streaming task paused, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
Comment 3 Víctor Manuel Jáquez Leal 2015-05-27 17:29:11 UTC
I confirm it.

Compiled gstreamer-vaapi current master within a federa22 and the pipeline is not negotiated.

I will check with gstreamer 1.4 tomorrow.
Comment 4 Víctor Manuel Jáquez Leal 2015-05-27 19:34:17 UTC
Created attachment 304101 [details] [review]
workaround: enable vaapidecodebin only for gstreamer-1.5
Comment 5 Víctor Manuel Jáquez Leal 2015-05-27 19:34:48 UTC
Does this workaround work for you??
Comment 6 Julian Sikorski 2015-05-28 18:31:37 UTC
It does - I tested with 619058b. Doesn't it disable HW acceleration thought? I will try to bisect and find the change which caused the playback to break.
Comment 7 Julian Sikorski 2015-05-28 19:40:04 UTC
$ git bisect log 
git bisect start
# bad: [619058b5b705d927a36061aa5b952d7ab856d7e6] encoder: hevc: Fix the size over-flow for encoded buffer.
git bisect bad 619058b5b705d927a36061aa5b952d7ab856d7e6
# good: [3d8e5e59a72aafc5d06917a3b22006278697a7d7] vaapidecode: keep src caps and output state in sync
git bisect good 3d8e5e59a72aafc5d06917a3b22006278697a7d7
# skip: [c7f41b770b1076634f475e923c509116010ac369] codecparsers: Update to gst-vaapi-branch commit 43a0368
git bisect skip c7f41b770b1076634f475e923c509116010ac369
# skip: [2ddfcd8bc373e093d446c0f74ab52902932534cf] decoder: hevc: Fix decoding when there are RASL pictures present.
git bisect skip 2ddfcd8bc373e093d446c0f74ab52902932534cf
# good: [3f456df92c0750c98840d76ab5b2a93ae5432338] build: fix make distcheck
git bisect good 3f456df92c0750c98840d76ab5b2a93ae5432338
# good: [0c2fc4a381d30c4f18843fe9f610ccfde82b3524] Changing source code download links from https://gitorious  to https://github
git bisect good 0c2fc4a381d30c4f18843fe9f610ccfde82b3524
# bad: [100d5971b59b2a0b93510625b6addd98b0ab44bb] plugins: more specific log message
git bisect bad 100d5971b59b2a0b93510625b6addd98b0ab44bb
# good: [504fdedf84cc356d002539abac0b263363c9d4a8] vaapisink: use GstVideoSink vmethod show_frame()
git bisect good 504fdedf84cc356d002539abac0b263363c9d4a8
# bad: [7e08786e1d38bf98c3aba2ad6d3498f0dfca07d3] vaapidecode: Use the GstVideoDecoder error reporting function
git bisect bad 7e08786e1d38bf98c3aba2ad6d3498f0dfca07d3
# bad: [b3eccdb72be42469ad0d4fc45ffb6a8f7b3ebf25] decoder: hevc: cosmetics.
git bisect bad b3eccdb72be42469ad0d4fc45ffb6a8f7b3ebf25
# bad: [b5425da1de221b678c8819df543f2775f1cf1ad7] display: drm: fix race condition setting device type
git bisect bad b5425da1de221b678c8819df543f2775f1cf1ad7
# good: [0adb36b6587b099724453bc4ef0aafb1b65a392f] videopool: Release lock while allocating new object
git bisect good 0adb36b6587b099724453bc4ef0aafb1b65a392f
# bad: [6f298f6182614cfaf9f3d043207ebe8a6141ffaf] vaapipostproc: Don't create filter on caps query
git bisect bad 6f298f6182614cfaf9f3d043207ebe8a6141ffaf
# first bad commit: [6f298f6182614cfaf9f3d043207ebe8a6141ffaf] vaapipostproc: Don't create filter on caps query
Comment 8 Víctor Manuel Jáquez Leal 2015-05-29 10:28:15 UTC
(In reply to Julian Sikorski from comment #6)
> It does - I tested with 619058b. 

Cool

> Doesn't it disable HW acceleration thought?

It doesn't disable it. The workaround disables the compilation of vaapidecodebin, which is a bin composed by vaapidecode and vaapispostproc. Without it, the playbin uses vaapidecode instead.

> I will try to bisect and find the change which caused the playback to break.

As you see in your bisect, the issue is in vaapipostroc.

That patch defers the creation of the filter (thus the vaapi display) until _start(). But it also frees the allowed sink caps which may cause this issue in gstreamer 1.4

In gstreamer 1.5 it works OK.
Comment 9 Víctor Manuel Jáquez Leal 2015-06-16 10:24:10 UTC
I have just realized that this report is using the nvidia backend. I need to confirm it, but perhaps the nvidia backend doesn't support the vaapipostroc.
Comment 10 sreerenj 2015-06-19 12:21:32 UTC
Similar one I think: https://bugzilla.gnome.org/show_bug.cgi?id=727841
Comment 11 Víctor Manuel Jáquez Leal 2015-06-26 11:31:35 UTC
Created attachment 306160 [details] [review]
vaapipostproc: return NULL caps if no filter available

THIS PATCH IS A WORK IN PROGRESS (don't apply)

This patch seems to do the trick with gstreamer 1.4 (decodebin tries
another encoder since vaapidecodebin fails to negotiate the sink caps)

But it raises a lot of awful warnings.
Comment 12 Gwenole Beauchesne 2015-06-26 11:38:28 UTC
Review of attachment 306160 [details] [review]:

Why not return empty caps instead of NULL?
Comment 13 Víctor Manuel Jáquez Leal 2015-06-26 13:41:08 UTC
(In reply to Gwenole Beauchesne from comment #12)
> Review of attachment 306160 [details] [review] [review]:
> 
> Why not return empty caps instead of NULL?

I tried, but there are still warnings (less, but still).

I'm thinking that vaapidecodebin should be in charge when the vaapipostroc fail and don't leave that burden to decodebin.
Comment 14 Víctor Manuel Jáquez Leal 2015-07-01 12:50:16 UTC
Created attachment 306492 [details] [review]
vaapidecodebin: enable vpp if it is available

Instead of creating and adding VPP into the bin at setup, we wait until
we are sure the VA driver supports it. We know that when the VA video
context is received by the bin. Afterwards, it is decided to instanciate
and link the VPP or not.

This is more efficient and safer than waiting the VPP to fail and then
disable it.
Comment 15 Víctor Manuel Jáquez Leal 2015-07-01 12:50:22 UTC
Created attachment 306493 [details] [review]
vaapidecodebin: notify if vpp is disabled

When the system is aware that VPP is not available by the VA driver,
it would be useful to notify to the user that the disable-vpp property
has changed.
Comment 16 sreerenj 2015-07-01 16:06:18 UTC
Both patches lgtm..

Did you manage to test the issue mentioned by the reporter??
I would appreciate if you can do some more testing with playbin to make sure that there is no regression..
make sure there is no issue for vaapidecodebin autoplugging in both 1.4 and 1.6,
no problem for falling back to software decoder if a particular profile is not supported by HW decoder,  test couple of of pipelines with "decodebin ! sink" combination etc...

Also what will happen if decoder produce a yuv format which is not supported by the vaapipostproc??

QA already started regression testing, but I would like to include this one also for 0.6...so we need to integrate it soon...

Once you did enough testing from your side, please feel free to push the patches..I will ask QA to restart the testing,

Thanks Victor :)
Comment 17 sreerenj 2015-07-01 16:08:58 UTC
(In reply to sreerenj from comment #16)
> Both patches lgtm..
> 
> Also what will happen if decoder produce a yuv format which is not supported
> by the vaapipostproc??

Aha, stupid me.. This won't happen..forget about this comment :)
Comment 18 Víctor Manuel Jáquez Leal 2015-07-01 16:32:08 UTC
(In reply to sreerenj from comment #16)
> Both patches lgtm..

:O)

> 
> Did you manage to test the issue mentioned by the reporter??

Julian: ping?

Could you try these patches?

> I would appreciate if you can do some more testing with playbin to make sure
> that there is no regression..

So far:

HSW     gst-1.5.x OK
nVidia  gst-1.4.5 OK

> make sure there is no issue for vaapidecodebin autoplugging in both 1.4 and
> 1.6,
> no problem for falling back to software decoder if a particular profile is
> not supported by HW decoder,  test couple of of pipelines with "decodebin !
> sink" combination etc...

> QA already started regression testing, but I would like to include this one
> also for 0.6...so we need to integrate it soon...

Roger.

> 
> Once you did enough testing from your side, please feel free to push the
> patches..I will ask QA to restart the testing,
> 

Cool.
Comment 19 sreerenj 2015-07-02 10:40:53 UTC
Older VA versions(0.32) needed this patch for sure... Otherwise gst-play-1.0 will simply fail. 
Another reason to push it for this release :)
Comment 20 Víctor Manuel Jáquez Leal 2015-07-02 11:04:08 UTC
HSW gst-1.4.5 OK

Pushing now.
Comment 21 Víctor Manuel Jáquez Leal 2015-07-02 11:08:11 UTC
Attachment 306492 [details] pushed as 5c799b3 - vaapidecodebin: enable vpp if it is available
Attachment 306493 [details] pushed as b4d9c0a - vaapidecodebin: notify if vpp is disabled
Comment 22 sreerenj 2015-07-03 12:11:52 UTC
5c799b3 introduced regression:

The following pipeline is failing in Gst 1.4..
.... decodebin ! vaapipostproc ! vaapisink 

Reopening...
Comment 23 Víctor Manuel Jáquez Leal 2015-07-06 18:53:36 UTC
Created attachment 306946 [details] [review]
vaapidecodebin: use constructed() to configure bin

GObjectClass provides a constructed() virtual method which is a proper place
to define the bin's pipeline.

This patch moves the gst_vaapi_decode_bin_configure() to constructed() virtual
method.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 24 Víctor Manuel Jáquez Leal 2015-07-06 18:53:42 UTC
Created attachment 306947 [details] [review]
vaapidecodebin: use pad templates in ghost pads

Instead of using the element's pad templates for creating the bin's ghost
pads, it is more coherent to use the bin's pad templates.

An unneeded cast was removed.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 25 Víctor Manuel Jáquez Leal 2015-07-06 18:53:48 UTC
Created attachment 306948 [details] [review]
vaapidecodebin: post an error message if fails

If the construction of the bin fails, post an error message in the bus.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 26 Víctor Manuel Jáquez Leal 2015-07-06 18:53:53 UTC
Created attachment 306949 [details] [review]
vaapidecodebin: add postprocessor dynamically

The former approach to left the bin unfinished has some problems, because we
could not assure that the bin was completely linked when the pipeline
started.

This approach uses the concepts of dynamic pipelines, as explained in
https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/

Initially the bin is fully functional, constructed as

(--------------------------------------------------)
|                vaapidecodebin                    |
|   (-------------)    (-------)    (----------)   |
|<--| vaapidecode |--->| queue |--->| identity |-->|
|   (-------------)    (-------)    (----------)   |
(--------------------------------------------------)

When the VaapiContext is shared and it has VPP capabilities, an idle pad probe
is launched. In the callback the bin is reconfigured dynamically, adding the
vaapipostproc element between the queue and the identity element:

(-----------------------------------------------------------------------)
|                                vaapidecodebin                         |
|   (-------------)    (-------)    (---------------)    (----------)   |
|<--| vaapidecode |--->| queue |--->| vaapipostproc |--->| identity |-->|
|   (-------------)    (-------)    (---------------)    (----------)   |
(-----------------------------------------------------------------------)

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 27 Víctor Manuel Jáquez Leal 2015-07-06 18:53:59 UTC
Created attachment 306950 [details] [review]
vaapidecodebin: check for postproc instance

If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 28 Víctor Manuel Jáquez Leal 2015-07-06 18:54:05 UTC
Created attachment 306951 [details] [review]
vaapidecodebin: remove postproc dynamically

Following the previous patch, this patch removes the VPP from the bin
dynamically, if it is already configured.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 29 sreerenj 2015-07-07 11:37:24 UTC
Created attachment 306998 [details]
pipeline_graph

Please see the attached pipeline graph for:
gst-launch-1.0 filesrc location=sample.mp4 ! decodebin ! vaapipostproc ! vaapisink 

There is only one vaapipostproc in the pipeline it seems!
Comment 30 Víctor Manuel Jáquez Leal 2015-07-07 12:13:33 UTC
Comment on attachment 306951 [details] [review]
vaapidecodebin: remove postproc dynamically

Testing this feature, the pipeline breaks. For now let's keep this feature as a TODO
Comment 31 Víctor Manuel Jáquez Leal 2015-07-07 12:20:40 UTC
(In reply to sreerenj from comment #29)
> Created attachment 306998 [details]
> pipeline_graph
> 
> Please see the attached pipeline graph for:
> gst-launch-1.0 filesrc location=sample.mp4 ! decodebin ! vaapipostproc !
> vaapisink 
> 
> There is only one vaapipostproc in the pipeline it seems!

The GST_MESSAGE_HAVE_CONTEXT never reach the vaapidecodebin's message handler when the outer vaapipostproc emits the VAAPI context.

I'm confused :S
Comment 32 sreerenj 2015-07-07 13:09:51 UTC
Also these patches are quite non-trivial and may affect other playback scenarios too.For eg, we haven't tested loop-playback and all...
 
I am again proposing to disable vaapidecodebin for this release :)

Actually not disabling, we can decrease the RANK of vaapidecodebin so that vaapidecode will get autoplugged ahead of vaapidecodebin in normal playback cases(decodebin, playbin,,,)..

I agree that we lose the benefit of HW accelerated de-interlacing by default,  but still I prefer to be in the safe side by selecting vaapidecode as natural choice since it is the stable element...

We can increase the rank after this release so that we will get enough feedback/tests for vaapidecodebin by the time we release 0.7...
 
@Gwenole/@Victor ???
Comment 33 Víctor Manuel Jáquez Leal 2015-07-07 15:28:26 UTC
(In reply to sreerenj from comment #32)
> Also these patches are quite non-trivial and may affect other playback
> scenarios too.For eg, we haven't tested loop-playback and all...

Very true.

There's another alternative to these patches:

When vaapipostproc is instantiated, before adding it into the bin, it is set to PAUSED state. If it fails (after generating a VAAPI context for itself) it is ditched and the src ghost pad connects to the queue's src pad, otherwise it is returned to NULL state and linked in the bin.

The main drawback is that the instantiate of vaapidecodebin will take longer.

>  
> I am again proposing to disable vaapidecodebin for this release :)
> 
> Actually not disabling, we can decrease the RANK of vaapidecodebin so that
> vaapidecode will get autoplugged ahead of vaapidecodebin in normal playback
> cases(decodebin, playbin,,,)..

It sounds like a plan.


> I agree that we lose the benefit of HW accelerated de-interlacing by
> default,  but still I prefer to be in the safe side by selecting vaapidecode
> as natural choice since it is the stable element...
> 
> We can increase the rank after this release so that we will get enough
> feedback/tests for vaapidecodebin by the time we release 0.7...
>  
> @Gwenole/@Victor ???
Comment 34 sreerenj 2015-07-08 05:11:21 UTC
commit 3ccb198b513dc6ad287fe44117d03bec4d6a966a
Author: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Date:   Tue Jul 7 20:57:20 2015 +0300

    Marking rank of vaapidecodebin as GST_RANK_MARGINAL for now.
    
    Unfortunately vaapidecodebin element is not seems to be stable
    enough for autoplugging ahead of vaapidecode.
    Lowering the rank for now (cosidering the immediate 0.6 release).
    
    See this: https://bugzilla.gnome.org/show_bug.cgi?id=749554
    
    Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Comment 35 Víctor Manuel Jáquez Leal 2015-08-06 17:21:57 UTC
Comment on attachment 306946 [details] [review]
vaapidecodebin: use constructed() to configure bin

Let's postpone this a bit.
Comment 36 Víctor Manuel Jáquez Leal 2015-08-06 17:26:22 UTC
Created attachment 308863 [details] [review]
vaapidecodebin: has_vpp as a tri-state variable

has_vpp can be UNKNOWN while the context message hasn't being received.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 37 Víctor Manuel Jáquez Leal 2015-08-06 17:26:28 UTC
Created attachment 308864 [details] [review]
vaapidecodebin: post an error message if fails

If the construction of the bin fails, post an error message in the bus.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 38 Víctor Manuel Jáquez Leal 2015-08-06 17:26:34 UTC
Created attachment 308865 [details] [review]
vaapidecodebin: ensure VPP before going to READY

There are sometimes that the VA-API display context is not shared among the
pipeline, but it is important to know it before going to READY state (when the
pipeline is already linked).

One instance of this case is this:

gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink

This patch adds a new function in gstvaapipluginutil called
gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API
display, which only will be used for verify if the VAEntrypointVideoProc is
available by the hardware. Afterwards, it should be unrefed.

If the vaapidecodebin is going to READY state, and the element still doesn't
know if VPP is available, the last resort is to create a new instance of the
VA-API display and test for it.
Comment 39 Víctor Manuel Jáquez Leal 2015-08-06 17:26:40 UTC
Created attachment 308866 [details] [review]
vaapidecodebin: check for postproc instance

If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Comment 40 Víctor Manuel Jáquez Leal 2015-08-13 15:55:55 UTC
Attachment 308863 [details] pushed as 0004301 - vaapidecodebin: has_vpp as a tri-state variable
Attachment 308864 [details] pushed as 1e061c5 - vaapidecodebin: post an error message if fails
Attachment 308865 [details] pushed as ee5d8ee - vaapidecodebin: ensure VPP before going to READY
Attachment 308866 [details] pushed as 7f34c6e - vaapidecodebin: check for postproc instance