summaryrefslogtreecommitdiff
path: root/test/v4l2_subdevice/test_formats.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-04-30 21:16:28 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-04-30 22:18:42 +0300
commita2dddf7c26df3307b9d4554c25387a00687a6234 (patch)
treebe4004bb072d39d471ee790069e3f74d1cd5bbe0 /test/v4l2_subdevice/test_formats.cpp
parentbaad55d00975f8931d51c333def20472457dc943 (diff)
libcamera: Use the Size class through libcamera
Several of our structures include width and height fields that model a size while we have a Size class for that purpose. Use the Size class through libcamera, and give it a toString() method like other geometry and format classes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test/v4l2_subdevice/test_formats.cpp')
-rw-r--r--test/v4l2_subdevice/test_formats.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/v4l2_subdevice/test_formats.cpp b/test/v4l2_subdevice/test_formats.cpp
index af954459..e90c2c24 100644
--- a/test/v4l2_subdevice/test_formats.cpp
+++ b/test/v4l2_subdevice/test_formats.cpp
@@ -44,8 +44,7 @@ int FormatHandlingTest::run()
/*
* Set unrealistic image resolutions and make sure it gets updated.
*/
- format.width = UINT_MAX;
- format.height = UINT_MAX;
+ format.size = { UINT_MAX, UINT_MAX };
ret = scaler_->setFormat(0, &format);
if (ret) {
cerr << "Failed to set format: image resolution is wrong, but "
@@ -53,13 +52,13 @@ int FormatHandlingTest::run()
return TestFail;
}
- if (format.width == UINT_MAX || format.height == UINT_MAX) {
+ if (format.size.width == UINT_MAX ||
+ format.size.height == UINT_MAX) {
cerr << "Failed to update image format" << endl;
return TestFail;
}
- format.width = 0;
- format.height = 0;
+ format.size = { 0, 0 };
ret = scaler_->setFormat(0, &format);
if (ret) {
cerr << "Failed to set format: image resolution is wrong, but "
@@ -67,7 +66,7 @@ int FormatHandlingTest::run()
return TestFail;
}
- if (format.width == 0 || format.height == 0) {
+ if (format.size.width == 0 || format.size.height == 0) {
cerr << "Failed to update image format" << endl;
return TestFail;
}