Skip to content

vaapi: libs: video-format: Check if formats map is not NULL.

Formats map is instantiated at the end of the display instantiation. The problem is the Wayland display which looks for a format in a callback, before the map is populated.

If user compiles gstreamer-vaapi with DRM support, the map is populated with a DRM display at GStreamer plugin registration. But if not, or a VA driver is not available, the plugin will try with a Wayland driver, which cause the NULL de-reference.

Nevertheless, in the case of no DRM support, and if the Wayland display doesn't get a reply from the format conversion is not a problem.

So the solution is the trivial one, check if the format map is already populated before de-reference it.

Fixes: #977 (closed)


Platform wise, is not possible, as far as I known, to have Wayland without kernel's DRM. Though, it's possible to configure gstreamer-vaapi without DRM but Wayland support, with the enhanced handling of dmabuf in vaapisink for Wayland, vaapisink will always fail. Given both issues, configuration with no DRM but Wayland, makes things more complex, and a simpler approach is to refuse that configuration.

This patch disables Wayland support if there isn't DRM support.

Merge request reports

Loading