GNOME Bugzilla – Bug 768161
vaapipostproc: don't share VA display before caps negotiation
Last modified: 2016-07-01 10:03:14 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.
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?
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.
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);
Created attachment 330558 [details] [review] vaapipostproc: don't require a vaapi display for all caps queries
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
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.
I'm sorry Matthew, I didn't review your patch properly. Can you test this one in your setup?
Review of attachment 330564 [details] [review]: This still works in my setup.
Attachment 330564 [details] pushed as 649c00d - vaapipostproc: return caps template if no display