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 768161 - vaapipostproc: don't share VA display before caps negotiation
vaapipostproc: don't share VA display before caps negotiation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
git master
Other Linux
: Normal normal
: 1.9.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-06-29 03:24 UTC by Matthew Waters (ystreet00)
Modified: 2016-07-01 10:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vaapipostproc: don't require a vaapi display for all caps queries (917 bytes, patch)
2016-06-29 10:26 UTC, Matthew Waters (ystreet00)
none Details | Review
vaapipostproc: don't require a vaapi display for all caps queries (1.60 KB, patch)
2016-06-29 11:10 UTC, Matthew Waters (ystreet00)
committed Details | Review
vaapipostproc: return caps template if no display (2.66 KB, patch)
2016-06-29 12:05 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Matthew Waters (ystreet00) 2016-06-29 03:24:13 UTC
(Ignoring the fact that this functionality is not technically exposed)

Have a pipeline with either vaapipostproc or vaapisink created using gst_parse_launch() what happens is this.

vaapisink will want a vaapi display on GstElement::set_bus which is called when adding the element to a bin/pipeline.  This seems to have been added because of the next issue so that vaapisink creates the display first.

vaapipostproc wants a display on any caps queries which by default happen when linking elements together.  This really should not have been added in the first place.  If you don't have a display, just return the pad template instead.

This all works in decodebin/playbin because 1. it links manually and 2. without checks.

When using gst_parse_launch(), both of these operations happen before the pipeline is returned the the caller so there is no chance to attach a sync bus message handler to respond to the need-context message.
Comment 1 Víctor Manuel Jáquez Leal 2016-06-29 10:13:43 UTC
Trying to understand this, the problem would be in vaapipostproc, and the fix to delay the display sharing through gstcontext, after the pipeline linking. Am I right?
Comment 2 Matthew Waters (ystreet00) 2016-06-29 10:26:10 UTC
Created attachment 330542 [details] [review]
vaapipostproc: don't require a vaapi display for all caps queries

This what I've come up with for vaapipostproc and have performed some simple tests that seem to indicate things still work.  Tested with both a vaapi sink (not vaapisink) and xvimagesink.
Comment 3 Víctor Manuel Jáquez Leal 2016-06-29 10:45:36 UTC
Review of attachment 330542 [details] [review]:

::: gst/vaapi/gstvaapipostproc.c
@@ +945,2 @@
   /* Append raw video caps */
+  if (GST_VAAPI_PLUGIN_BASE (postproc)->display) {

Thanks!

I would set an else block to add the raw caps in the template:

raw_caps =  gst_caps_from_string (GST_VIDEO_CAPS_MAKE (GST_VIDEO_FORMATS_ALL) ", "
      GST_CAPS_INTERLACED_MODES);
Comment 4 Matthew Waters (ystreet00) 2016-06-29 11:10:20 UTC
Created attachment 330558 [details] [review]
vaapipostproc: don't require a vaapi display for all caps queries
Comment 5 Matthew Waters (ystreet00) 2016-06-29 11:36:23 UTC
commit 6d73ca8da2bc0b33262307c0fd1d5e64dc819655
Author: Matthew Waters <matthew@centricular.com>
Date:   Wed Jun 29 16:42:18 2016 +1000

    vaapipostproc: don't require a vaapi display for all caps queries
    
    This delays the requirement of having a GstVaapiDisplay until later
    
    https://bugzilla.gnome.org/show_bug.cgi?id=768161
Comment 6 Víctor Manuel Jáquez Leal 2016-06-29 12:05:23 UTC
Created attachment 330564 [details] [review]
vaapipostproc: return caps template if no display

This patch is a fix for my bad review of commit 6d73ca8d. The element should
be able to return the available raw caps handled by the VA display, but that
only should happen when there a VA display. If there's none, the element
should use the caps template.
Comment 7 Víctor Manuel Jáquez Leal 2016-06-29 12:06:34 UTC
I'm sorry Matthew, I didn't review your patch properly.

Can you test this one in your setup?
Comment 8 Matthew Waters (ystreet00) 2016-06-29 12:24:34 UTC
Review of attachment 330564 [details] [review]:

This still works in my setup.
Comment 9 Víctor Manuel Jáquez Leal 2016-06-29 13:22:20 UTC
Attachment 330564 [details] pushed as 649c00d - vaapipostproc: return caps template if no display