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 765223 - plugins: simplify caps feature selection and honour negotiated colour format
plugins: simplify caps feature selection and honour negotiated colour format
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: 752958
 
 
Reported: 2016-04-18 16:17 UTC by Víctor Manuel Jáquez Leal
Modified: 2016-04-29 08:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
plugin: simplify caps feature selection (5.74 KB, patch)
2016-04-18 16:28 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugin: honour negotiated format (4.65 KB, patch)
2016-04-18 16:28 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
vaapidecode: warns if driver will do color conversions (1.54 KB, patch)
2016-04-18 16:28 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugin: remove function parameter (4.15 KB, patch)
2016-04-18 16:29 UTC, Víctor Manuel Jáquez Leal
committed Details | Review
plugin: use allowed caps filter from element (5.87 KB, patch)
2016-04-18 16:29 UTC, Víctor Manuel Jáquez Leal
committed Details | Review

Description Víctor Manuel Jáquez Leal 2016-04-18 16:17:48 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.
Comment 1 Víctor Manuel Jáquez Leal 2016-04-18 16:28:48 UTC
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.
Comment 2 Víctor Manuel Jáquez Leal 2016-04-18 16:28:53 UTC
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.
Comment 3 Víctor Manuel Jáquez Leal 2016-04-18 16:28:59 UTC
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.
Comment 4 Víctor Manuel Jáquez Leal 2016-04-18 16:29:04 UTC
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.
Comment 5 Víctor Manuel Jáquez Leal 2016-04-18 16:29:09 UTC
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 6 Víctor Manuel Jáquez Leal 2016-04-22 14:51:41 UTC
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 7 Víctor Manuel Jáquez Leal 2016-04-22 14:52:10 UTC
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 8 Víctor Manuel Jáquez Leal 2016-04-22 14:53:32 UTC
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 9 Víctor Manuel Jáquez Leal 2016-04-22 14:54:02 UTC
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 10 Víctor Manuel Jáquez Leal 2016-04-22 14:54:35 UTC
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