vaapipluginutil: ignore dmabuf type when building caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7708>
This commit is contained in:
Víctor Manuel Jáquez Leal 2024-10-28 14:11:50 +01:00
parent 16d4624058
commit d993b8636f

View file

@ -1105,9 +1105,7 @@ GstCaps *
gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width, gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width,
gint min_height, gint max_width, gint max_height, guint mem_types) gint min_height, gint max_width, gint max_height, guint mem_types)
{ {
GstCaps *out_caps, *raw_caps, *va_caps, *dma_caps; GstCaps *out_caps, *raw_caps, *va_caps;
dma_caps = NULL;
raw_caps = gst_vaapi_video_format_new_template_caps_from_list (formats); raw_caps = gst_vaapi_video_format_new_template_caps_from_list (formats);
if (!raw_caps) if (!raw_caps)
@ -1124,15 +1122,10 @@ gst_vaapi_build_caps_from_formats (GArray * formats, gint min_width,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) || GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) ||
gst_vaapi_mem_type_supports (mem_types, gst_vaapi_mem_type_supports (mem_types,
GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2)) { GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF2)) {
dma_caps = gst_caps_copy (raw_caps); GST_INFO ("Ignoring DMABuf caps");
gst_caps_set_features_simple (dma_caps,
gst_caps_features_new_static_str (GST_CAPS_FEATURE_MEMORY_DMABUF,
NULL));
} }
out_caps = va_caps; out_caps = va_caps;
if (dma_caps)
gst_caps_append (out_caps, dma_caps);
gst_caps_append (out_caps, raw_caps); gst_caps_append (out_caps, raw_caps);
return out_caps; return out_caps;