vaapipluginutil: Use GST_VAAPI_DISPLAY_TYPE_DRM for Mesa3D GBM
authorHaihao Xiang <haihao.xiang@intel.com>
Sun, 26 Apr 2020 05:30:16 +0000 (13:30 +0800)
committerHaihao Xiang <haihao.xiang@intel.com>
Sun, 26 Apr 2020 06:55:30 +0000 (14:55 +0800)
We may build this plugin with window system support but run it without
window system. Without this patch, the following pipeline will trigger a
segfault when running it without window system.

gst-launch-1.0 filesrc location=input.264 ! h264parse ! vaapih264dec ! fakesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/319>

gst/vaapi/gstvaapipluginutil.c

index e344649..ba89b4a 100644 (file)
@@ -157,6 +157,11 @@ gst_vaapi_get_display_type_from_gl (GstGLDisplayType gl_display_type,
       return GST_VAAPI_DISPLAY_TYPE_EGL;
     }
 #endif
+#if USE_DRM
+    case GST_GL_DISPLAY_TYPE_GBM:{
+      return GST_VAAPI_DISPLAY_TYPE_DRM;
+    }
+#endif
     default:
       /* unsupported display. Still DRM may work. */
       break;