diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c index be2e7dfa1b..fbc638c81e 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasedec.c @@ -487,6 +487,12 @@ gst_va_base_dec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query) has_video_crop_meta = has_videometa && gst_query_find_allocation_meta (query, GST_VIDEO_CROP_META_API_TYPE, NULL); + if (gst_video_is_dma_drm_caps (caps) && !has_videometa) { + GST_ERROR_OBJECT (base, + "DMABuf caps negotiated without the mandatory support of VideoMeta "); + return FALSE; + } + /* 1. The output picture locates in the middle of the decoded buffer, but the downstream element does not support VideoCropMeta, we definitely need a copy. diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c index 458955b923..65de9b7d59 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabasetransform.c @@ -338,6 +338,14 @@ gst_va_base_transform_decide_allocation (GstBaseTransform * trans, if (!outcaps) return FALSE; + has_videometa = gst_query_find_allocation_meta (query, + GST_VIDEO_META_API_TYPE, NULL); + if (gst_video_is_dma_drm_caps (outcaps) && !has_videometa) { + GST_ERROR_OBJECT (trans, + "DMABuf caps negotiated without the mandatory support of VideoMeta "); + return FALSE; + } + if (gst_query_get_n_allocation_params (query) > 0) { GstVaDisplay *display; @@ -423,9 +431,6 @@ gst_va_base_transform_decide_allocation (GstBaseTransform * trans, else gst_query_add_allocation_pool (query, pool, size, min, max); - has_videometa = gst_query_find_allocation_meta (query, - GST_VIDEO_META_API_TYPE, NULL); - copy_frames = (!has_videometa && gst_va_pool_requires_video_meta (pool) && gst_caps_is_raw (outcaps)); if (copy_frames) { diff --git a/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c b/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c index 9bd9dfc797..4b5a5fac4a 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvacompositor.c @@ -666,6 +666,14 @@ gst_va_compositor_decide_allocation (GstAggregator * agg, GstQuery * query) if (!caps) return FALSE; + has_videometa = gst_query_find_allocation_meta (query, + GST_VIDEO_META_API_TYPE, NULL); + if (gst_video_is_dma_drm_caps (caps) && !has_videometa) { + GST_ERROR_OBJECT (self, + "DMABuf caps negotiated without the mandatory support of VideoMeta "); + return FALSE; + } + if (gst_query_get_n_allocation_params (query) > 0) { GstVaDisplay *display; @@ -762,9 +770,6 @@ gst_va_compositor_decide_allocation (GstAggregator * agg, GstQuery * query) else gst_query_add_allocation_pool (query, pool, size, min, max); - has_videometa = gst_query_find_allocation_meta (query, - GST_VIDEO_META_API_TYPE, NULL); - copy_frames = (!has_videometa && gst_va_pool_requires_video_meta (pool) && gst_caps_is_raw (caps)); if (copy_frames) {