summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 2e458fcc..281f3f13 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1356,7 +1356,7 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
const FileDescriptor &fd = planes[0].fd;
size_t offset = 0;
- for (size_t i = 0; i < planes.size(); ++i) {
+ for (auto [i, plane] : utils::enumerate(planes)) {
/*
* The stride is reported by V4L2 for the first plane
* only. Compute the stride of the other planes by
@@ -1368,11 +1368,11 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
* formatInfo_->planes[i].bytesPerGroup
/ formatInfo_->planes[0].bytesPerGroup;
- planes[i].fd = fd;
- planes[i].offset = offset;
- planes[i].length = formatInfo_->planeSize(format_.size.height,
- i, stride);
- offset += planes[i].length;
+ plane.fd = fd;
+ plane.offset = offset;
+ plane.length = formatInfo_->planeSize(format_.size.height,
+ i, stride);
+ offset += plane.length;
}
}