Skip to content

libs: context: select vaCreateSurfaces version according attributes

This commit tries to centralize the selection of vaCreateSurfaces version, instead of having fallbacks everywhere.

These fallbacks are hacks, added because new drivers use the latest version of vaCreateSurfaces (with surface attributes) [1], meanwhile old drivers (or profiles as JPEG decoder in i965) might rather use the old version.

In order to select which method, there's detected hack: each config context has a list of valid formats, in the case of JPEG decoder the list only contains "rare" 4:2:2 formats (ICM3, GRAY8) which aren't handled correctly by the current gstreamer-vaapi code [2].

The hack consist in identify if the format list contains an arbitrary preferred format (which is supposedly well supported by gstreamer-vaapi, mostly NV12). If no preferred colour format is found, the the old version of vaCreateSurfaces is used, and the surfaces will be mapped into a image with their own color format.

  1. https://bugzilla.gnome.org/show_bug.cgi?id=797143
  2. https://bugzilla.gnome.org/show_bug.cgi?id=797222

@haihao, @He_Junyan, @ullysses.a.eoff: can you run this MR in Intel's CI?

Merge request reports