diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-07-01 22:05:09 +0200 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-07-23 16:31:41 +0200 |
commit | dcda73ec14a69d303456cb8ab4869410c29bd762 (patch) | |
tree | da39c75d2825cac7b0fa73dcbb5d1626e6585233 /test/v4l2_subdevice | |
parent | d9295552b17c72c57357e901cd256bcf66528233 (diff) |
libcamera: v4l2_subdevice: Replace ImageFormats with a map
Replace the V4L2Subdevice usage of the ImageFormats class with a
std::map and the utils::map_keys() helper.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'test/v4l2_subdevice')
-rw-r--r-- | test/v4l2_subdevice/list_formats.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/v4l2_subdevice/list_formats.cpp b/test/v4l2_subdevice/list_formats.cpp index a55af110..a6044c04 100644 --- a/test/v4l2_subdevice/list_formats.cpp +++ b/test/v4l2_subdevice/list_formats.cpp @@ -47,29 +47,29 @@ void ListFormatsTest::printFormats(unsigned int pad, int ListFormatsTest::run() { /* List all formats available on existing "Scaler" pads. */ - ImageFormats formats; + V4L2Subdevice::Formats formats; formats = scaler_->formats(0); - if (formats.isEmpty()) { + if (formats.empty()) { cerr << "Failed to list formats on pad 0 of subdevice " << scaler_->entity()->name() << endl; return TestFail; } - for (unsigned int code : formats.formats()) - printFormats(0, code, formats.sizes(code)); + for (unsigned int code : utils::map_keys(formats)) + printFormats(0, code, formats[code]); formats = scaler_->formats(1); - if (formats.isEmpty()) { + if (formats.empty()) { cerr << "Failed to list formats on pad 1 of subdevice " << scaler_->entity()->name() << endl; return TestFail; } - for (unsigned int code : formats.formats()) - printFormats(1, code, formats.sizes(code)); + for (unsigned int code : utils::map_keys(formats)) + printFormats(1, code, formats[code]); /* List format on a non-existing pad, format vector shall be empty. */ formats = scaler_->formats(2); - if (!formats.isEmpty()) { + if (!formats.empty()) { cerr << "Listing formats on non-existing pad 2 of subdevice " << scaler_->entity()->name() << " should return an empty format list" << endl; |