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 775204 - vaapipostproc: gst buffer arrives before caps event in queue
vaapipostproc: gst buffer arrives before caps event in queue
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.10.3
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 774241
 
 
Reported: 2016-11-28 06:51 UTC by Hyunjun Ko
Modified: 2017-01-06 12:38 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapipostproc: update src caps if changed to notify downstream (2.75 KB, patch)
2017-01-04 07:09 UTC, Hyunjun Ko
none Details | Review
vaapipostproc: update src caps if changed to notify downstream (2.76 KB, patch)
2017-01-04 10:25 UTC, Hyunjun Ko
committed Details | Review

Description Hyunjun Ko 2016-11-28 06:51:31 UTC
Failures:
validate.file.transcode.to_rawaudio_and_prores_in_quicktime.mp3_h264_0_mp4
validate.file.transcode.to_vorbis_and_theora_in_ogg.mp3_h264_1_mp4
and 3-4 more testcases like this.

Investigation so far:
Queue(the fisrt queue in encodebin, before streamsplitter) get gstbuffer, then caps event arrives.
It tries to push buffer first, and fails due to not-negotiated.

I don't know why gst buffer arrives at the queue even before negotiation is done in encodebin and caps event arrives.
Comment 1 Hyunjun Ko 2017-01-04 07:08:21 UTC
More investigation:
The first buffer that I mentioned above has vaapi surface caps feature.
That's why it fails with not-negotiated.
It should be changed to system memory before start processing in this pipeline.
And currently vaapipostproc doesn't notify when it's changed.
Comment 2 Hyunjun Ko 2017-01-04 07:09:03 UTC
Created attachment 342813 [details] [review]
vaapipostproc: update src caps if changed to notify  downstream

If src pad caps is changed, it needs to notify downstream.

In addition, do not set passthrough in this case.
Otherwise, if it's TRUE, transform sometimes starts processing 
before caps change.
The passthrough value will be set in fixate later in this case.
Comment 3 Víctor Manuel Jáquez Leal 2017-01-04 10:03:35 UTC
Review of attachment 342813 [details] [review]:

Thanks!  Good catch!

Just a silly code style thing.

::: gst/vaapi/gstvaapipostproc.c
@@ +1314,3 @@
+  if (!src_caps_changed)
+    /* set passthrough according to caps changes or filter changes */
+    gst_vaapipostproc_set_passthrough (trans);

please wrap the if with braces or move the comment above the if
Comment 4 Hyunjun Ko 2017-01-04 10:25:09 UTC
Created attachment 342818 [details] [review]
vaapipostproc: update src caps if changed to notify downstream

If src pad caps is changed, it needs to notify downstream.

In addition, do not set passthrough in this case.
Otherwise, if it's TRUE, transform sometimes starts processing 
before caps change.
The passthrough value will be set in fixate later in this case.
Comment 5 Víctor Manuel Jáquez Leal 2017-01-06 11:12:27 UTC
Review of attachment 342818 [details] [review]:

lgtm
Comment 6 Víctor Manuel Jáquez Leal 2017-01-06 12:31:15 UTC
commit b23640fb2715c215c739a624a9201420d47004d4
Author: Hyunjun Ko <zzoon@igalia.com>
Date:   Wed Jan 4 19:23:06 2017 +0900

    vaapipostproc: notify if src pad caps changed

    If src pad caps have changed, it needs to notify it downstream. In
    addition, do not set passthrough if they have changed.

    Otherwise, transform sometimes starts processing before caps change.
    The passthrough value will be set in fixate later in this case.

    https://bugzilla.gnome.org/show_bug.cgi?id=775204
Comment 7 Víctor Manuel Jáquez Leal 2017-01-06 12:37:23 UTC
commit 4ca80871e808db8d24b375078b93b92cf0fd0c0d
Author: Hyunjun Ko <zzoon@igalia.com>
Date:   Wed Jan 4 19:23:06 2017 +0900

    vaapipostproc: notify if src pad caps changed

    If src pad caps have changed, it needs to notify it downstream. In
    addition, do not set passthrough if they have changed.

    Otherwise, transform sometimes starts processing before caps change.
    The passthrough value will be set in fixate later in this case.

    https://bugzilla.gnome.org/show_bug.cgi?id=775204