mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1355>
This commit is contained in:
parent
6d7dc93a45
commit
a87be69ce5
1 changed files with 12 additions and 0 deletions
|
@ -4597,6 +4597,18 @@ gst_v4l2_object_match_buffer_layout (GstV4l2Object * obj, guint n_planes,
|
||||||
offset[p], obj->info.offset[p], p);
|
offset[p], obj->info.offset[p], p);
|
||||||
need_fmt_update = TRUE;
|
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) {
|
if (need_fmt_update) {
|
||||||
|
|
Loading…
Reference in a new issue