summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-15 02:56:20 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-19 15:08:14 +0200
commita69414529f463ba1d2f0fa4a9e80538193f9b099 (patch)
tree1f642863e783ea0f18a905e164a40de420ea3351 /src/libcamera/v4l2_videodevice.cpp
parent4ff18e95063bbb70f6e0971774fcd2a1b0ad2b58 (diff)
libcamera: geometry: Construct SizeRange from Size
The SizeRange constructors take minimum and maximum width and height values as separate arguments. We have a Size class to convey size information, use it in the constructors, and update the callers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index fde8bd88..56251a46 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -971,20 +971,20 @@ std::vector<SizeRange> V4L2VideoDevice::enumSizes(unsigned int pixelFormat)
switch (frameSize.type) {
case V4L2_FRMSIZE_TYPE_DISCRETE:
- sizes.emplace_back(frameSize.discrete.width,
- frameSize.discrete.height);
+ sizes.emplace_back(Size{ frameSize.discrete.width,
+ frameSize.discrete.height });
break;
case V4L2_FRMSIZE_TYPE_CONTINUOUS:
- sizes.emplace_back(frameSize.stepwise.min_width,
- frameSize.stepwise.min_height,
- frameSize.stepwise.max_width,
- frameSize.stepwise.max_height);
+ sizes.emplace_back(Size{ frameSize.stepwise.min_width,
+ frameSize.stepwise.min_height },
+ Size{ frameSize.stepwise.max_width,
+ frameSize.stepwise.max_height });
break;
case V4L2_FRMSIZE_TYPE_STEPWISE:
- sizes.emplace_back(frameSize.stepwise.min_width,
- frameSize.stepwise.min_height,
- frameSize.stepwise.max_width,
- frameSize.stepwise.max_height,
+ sizes.emplace_back(Size{ frameSize.stepwise.min_width,
+ frameSize.stepwise.min_height },
+ Size{ frameSize.stepwise.max_width,
+ frameSize.stepwise.max_height },
frameSize.stepwise.step_width,
frameSize.stepwise.step_height);
break;