From: Trung Do Date: Mon, 1 Nov 2021 03:08:32 +0000 (+0700) Subject: v4l2: Update fmt if padded height is greater than fmt height X-Git-Tag: 1.20.0~283 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a87be69ce5eb6b91dc53732b4fcfad4bb77fb87b;p=platform%2Fupstream%2Fgstreamer.git v4l2: Update fmt if padded height is greater than fmt height If padded height is greater, buffer bytesused could be larger than plane length, and cause VIDIOC_QBUF failure. Part-of: --- diff --git a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c index 9851ffc..43121f6 100644 --- a/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c +++ b/subprojects/gst-plugins-good/sys/v4l2/gstv4l2object.c @@ -4597,6 +4597,18 @@ gst_v4l2_object_match_buffer_layout (GstV4l2Object * obj, guint n_planes, offset[p], obj->info.offset[p], p); need_fmt_update = TRUE; } + + if (padded_height) { + guint fmt_height; + + if (V4L2_TYPE_IS_MULTIPLANAR (obj->type)) + fmt_height = obj->format.fmt.pix_mp.height; + else + fmt_height = obj->format.fmt.pix.height; + + if (padded_height > fmt_height) + need_fmt_update = TRUE; + } } if (need_fmt_update) {