libcamera: camera_sensor: getControls(): Use span

The function takes a const std::vector reference, but it does
not actually need an `std::vector`. So use a `libcamera::Span`
instead to avoid forcing the caller to construct a vector.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2024-08-04 01:37:18 +02:00
parent 01a9b83f38
commit 39d37fce12
6 changed files with 31 additions and 18 deletions
+9 -5
View File
@@ -60,11 +60,15 @@ protected:
const ControlInfo &u8 = infoMap.find(VIVID_CID_U8_4D_ARRAY)->second;
/* Test getting controls. */
ControlList ctrls = capture_->getControls({ V4L2_CID_BRIGHTNESS,
V4L2_CID_CONTRAST,
V4L2_CID_SATURATION,
VIVID_CID_INTEGER64,
VIVID_CID_U8_4D_ARRAY });
static constexpr uint32_t cids[] = {
V4L2_CID_BRIGHTNESS,
V4L2_CID_CONTRAST,
V4L2_CID_SATURATION,
VIVID_CID_INTEGER64,
VIVID_CID_U8_4D_ARRAY,
};
ControlList ctrls = capture_->getControls(cids);
if (ctrls.empty()) {
cerr << "Failed to get controls" << endl;
return TestFail;