From 61d2231c582bb7c228c7c9b96a66b682304031aa Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Fri, 8 Nov 2024 16:22:16 -0500 Subject: [PATCH] v4l2codecs: decoder: Fixed unset dimension in caps When the driver does not implement ENUM_FRMESIZE for some specific formats, the caps limiting the sizes may endup empty, which results in assuming the driver can scale to any sizes. Ensure that the original size is in the caps to prevent this assumption. This happens with Hantro drive, since it only reply to that call if the format is postprocessed. Part-of: --- subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c index a843320272..6777ee6bb6 100644 --- a/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c +++ b/subprojects/gst-plugins-bad/sys/v4l2codecs/gstv4l2decoder.c @@ -448,7 +448,9 @@ gst_v4l2_decoder_probe_caps_for_format (GstV4l2Decoder * self, caps = gst_caps_new_simple ("video/x-raw", "format", G_TYPE_STRING, gst_video_format_to_string (format), NULL); - size_caps = gst_caps_new_empty (); + size_caps = gst_caps_new_simple ("video/x-raw", + "width", G_TYPE_INT, unscaled_width, + "height", G_TYPE_INT, unscaled_height, NULL); while ((tmp = gst_v4l2_decoder_enum_size_for_format (self, pixelformat, index++, unscaled_width, unscaled_height))) { size_caps = gst_caps_merge (size_caps, tmp);