v4l2codecs: h265dec: Fail when frame cropping is needed while using DMABuf

It is not possible to do frame cropping when DMABuf caps feature is negotiated.
The VideoInfo size is zero, resulting in empty destination buffers, and video
convert library may not understand what the format actually is.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9305>
This commit is contained in:
Nicolas Dufresne 2025-06-27 10:06:34 -04:00 committed by GStreamer Marge Bot
parent e7be87b3de
commit 5e2a4a6d13

View File

@ -501,10 +501,18 @@ gst_v4l2_codec_h265_dec_decide_allocation (GstVideoDecoder * decoder,
return FALSE;
}
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_video_is_dma_drm_caps (caps)) {
if (!has_videometa) {
GST_ERROR_OBJECT (self,
"DMABuf caps negotiated without the mandatory support of VideoMeta");
return FALSE;
}
if (self->need_crop) {
GST_ERROR_OBJECT (self,
"Frame cropping is not supported when DMABuf caps is negotiated.");
return FALSE;
}
}
/* Check if we can zero-copy buffers */