glx: Iterate over FBConfig and select 8 bit color size

Merged Rafał Dzięgiel requested to merge Rafostar/gstreamer-vaapi:fbconfig-8bit into master

Texture upload mechanism used by gstreamer-vaapi relies on 8 bpc. In latest mesa versions the first fbconfig might not be 8 bit, so iterate over it to find the correct config with supported values.

This is an alternative version of !152 (closed) with below differences:

  • Configure GLX_ALPHA_SIZE to 8 bit (required to get this working)
  • Iterate using a loop instead of copy-paste same code block multiple times
  • Loop breaks if any value is incorrect instead of collecting all values for each FBConfig (should be faster)
  • Also check for alpha value which must be either 0 (no alpha) or 8 bit

Fixes: #136 (closed)

Edited by Rafał Dzięgiel

Merge request reports