GNOME Bugzilla – Bug 765223
plugins: simplify caps feature selection and honour negotiated colour format
Last modified: 2016-04-29 08:44:26 UTC
The following patch set simplify the caps feature negotiation algorithm. Then, it is possible to honour the negotiated colour format, because right now, vaapidecode, though offers a set colour formats, they are just ignored.
Created attachment 326278 [details] [review] plugin: simplify caps feature selection This patch simplifies the function gst_vaapi_find_preferred_caps_feature(). Instead of intersecting custom caps to find the preferred feature, the peer caps are traversed in order to find the preferred feature, according to an ordered feature priority list. In the case of GLTextureUploadMeta, the colour format is computed using GstVideoInfo of the selected fixed caps.
Created attachment 326279 [details] [review] plugin: honour negotiated format Instead of setting the requested format by the caller, the function gst_vaapi_find_preferred_caps_feature() now returns, in the output parameter, the negotiated format. A new helper function was added: gst_vaapi_find_preferred_format(), which, given the format list from the negotiated caps, will choose the best one, if possible, given the native format.
Created attachment 326280 [details] [review] vaapidecode: warns if driver will do color conversions If the downstream feature is system memory, the surface has to be mapped, hence a warning message is logged saying that the driver has to do color conversions. This might be troublesome because not all the color conversion combinations are supported by the VA-API drivers, and there is not a reliable way to know them before hand.
Created attachment 326281 [details] [review] plugin: remove function parameter The native format parameter in gst_vaapi_find_preferred_caps_feature() can be saved if the out format is used for both: in and out. Thus the code is more readable.
Created attachment 326282 [details] [review] plugin: use allowed caps filter from element Instead of using the srcpad template caps for filtering the peer caps, the function gst_vaapi_find_preferred_caps_feature(), now receives a new parameter for the element's allowed caps. With this modification, the vaapipostproc element simplifies a bit its code.
Comment on attachment 326278 [details] [review] plugin: simplify caps feature selection commit ce6275020e7c1ff7af646857933f93726b73053a Author: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Date: Mon Mar 28 19:26:02 2016 +0200 plugin: simplify caps feature selection
Comment on attachment 326279 [details] [review] plugin: honour negotiated format commit b41db95c4efd28d4a2a7937cc0e84e854c0e4d4f Author: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Date: Tue Mar 29 13:28:27 2016 +0200 plugin: honour negotiated format
Comment on attachment 326280 [details] [review] vaapidecode: warns if driver will do color conversions commit 79ec3d00ef9938b3799d3cb29983d703411467db Author: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Date: Mon Apr 18 17:17:58 2016 +0200 vaapidecode: warns if driver will do color conversions
Comment on attachment 326281 [details] [review] plugin: remove function parameter commit 2d7d38cb9c4ec3e61aaa83d92103b95d0cf380d4 Author: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Date: Mon Apr 18 17:28:51 2016 +0200 plugin: remove function parameter
Comment on attachment 326282 [details] [review] plugin: use allowed caps filter from element commit 8d42c95b0f706a1bf1649bfafef607fc951e5027 Author: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> Date: Tue Mar 29 14:17:54 2016 +0200 plugin: use allowed caps filter from element