diff options
author | Daniel Scally <dan.scally@ideasonboard.com> | 2022-09-05 11:32:15 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-11-17 23:35:33 +0000 |
commit | 309af54c6fcbd00350af4f60f84994fbbaf785f5 (patch) | |
tree | f96ccc20bd4db500e885f1e210ec728fbb5e72a5 /lib/v4l2.c | |
parent | 2474ba2db603fe8ec0c8ef2055b3ceded99d3354 (diff) |
lib: v4l2: Set sizeimage during v4l2_set_format()
videobuf2 relies on the sizeimage field to calculate buffer size
when the format is MJPEG, because the bytes-per-line calculation
is missing. Fill in that field as part of v4l2_set_format() so the
API works correctly.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
Diffstat (limited to 'lib/v4l2.c')
-rw-r--r-- | lib/v4l2.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -487,6 +487,7 @@ int v4l2_set_format(struct v4l2_device *dev, struct v4l2_pix_format *format) fmt.fmt.pix.height = format->height; fmt.fmt.pix.pixelformat = format->pixelformat; fmt.fmt.pix.field = V4L2_FIELD_ANY; + fmt.fmt.pix.sizeimage = format->sizeimage; ret = ioctl(dev->fd, VIDIOC_S_FMT, &fmt); if (ret < 0) { |