https://chromium-review.googlesource.com/c/chromium/src/+/785690 introduced dynamic detection of the underlying display platform (DRM or X11) with the following code:
switch (gl::GetGLImplementation()) {
case gl::kGLImplementationEGLGLES2:
va_display_ = vaGetDisplayDRM(drm_fd_.get());
break;
case gl::kGLImplementationDesktopGL:
#if defined(USE_X11)
va_display_ = vaGetDisplay(gfx::GetXDisplay());
#else
LOG(WARNING) << "HW video decode acceleration not available without "
"DesktopGL (GLX).";
#endif // USE_X11
break;
default:
LOG(WARNING) << "HW video decode acceleration not available for "
<< gl::GetGLImplementationName(gl::GetGLImplementation());
return false;
}
This can cause issues because it assumes GL is initialized and will be used. However not all applications (in particular unit tests) will make use of GL. In this case gl::GetGLImplementation() will return gl::kGLImplementationNone, which is not handled and will return an initialization error.
VAAPI has little to do with GL anyway, so we should probably switch to a different way to detect the underlying display platform. This bug is to track this effort.