From dcda73ec14a69d303456cb8ab4869410c29bd762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Wed, 1 Jul 2020 22:05:09 +0200 Subject: libcamera: v4l2_subdevice: Replace ImageFormats with a map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the V4L2Subdevice usage of the ImageFormats class with a std::map and the utils::map_keys() helper. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- test/v4l2_subdevice/list_formats.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/v4l2_subdevice') 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; -- cgit v1.2.1