vaapi: Add new dmabuf mem type when building caps

Media-driver will return dmabuf mem type GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2
on the latest platform like Gen12. To enable build caps using dmabuf, need to
add the check for this type at gst_vaapi_build_caps_from_format.

This patch is a portion from Junyan.He@intel.com
https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/393

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1287>
This commit is contained in:
Mengkejiergeli Ba 2021-10-29 15:08:38 +08:00 committed by GStreamer Marge Bot
parent d8a477338f
commit 51f92fd15f

View file

@ -1120,7 +1120,9 @@ gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE));
if (gst_vaapi_mem_type_supports (mem_types,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF)) {
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) ||
gst_vaapi_mem_type_supports (mem_types,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2)) {
dma_caps = gst_caps_copy (raw_caps);
gst_caps_set_features_simple (dma_caps,
gst_caps_features_from_string (GST_CAPS_FEATURE_MEMORY_DMABUF));