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:
@@ -96,7 +96,7 @@ public:
|
||||
BayerFormat::Order bayerOrder(Transform t) const override;
|
||||
|
||||
const ControlInfoMap &controls() const override;
|
||||
ControlList getControls(const std::vector<uint32_t> &ids) override;
|
||||
ControlList getControls(Span<const uint32_t> ids) override;
|
||||
int setControls(ControlList *ctrls) override;
|
||||
|
||||
const std::vector<controls::draft::TestPatternModeEnum> &
|
||||
@@ -1022,9 +1022,13 @@ int CameraSensorRaw::sensorInfo(IPACameraSensorInfo *info) const
|
||||
* duration through V4L2 controls. Support for the V4L2_CID_PIXEL_RATE,
|
||||
* V4L2_CID_HBLANK and V4L2_CID_VBLANK controls is mandatory.
|
||||
*/
|
||||
ControlList ctrls = subdev_->getControls({ V4L2_CID_PIXEL_RATE,
|
||||
V4L2_CID_HBLANK,
|
||||
V4L2_CID_VBLANK });
|
||||
static constexpr uint32_t cids[] = {
|
||||
V4L2_CID_PIXEL_RATE,
|
||||
V4L2_CID_HBLANK,
|
||||
V4L2_CID_VBLANK,
|
||||
};
|
||||
|
||||
ControlList ctrls = subdev_->getControls(cids);
|
||||
if (ctrls.empty()) {
|
||||
LOG(CameraSensor, Error)
|
||||
<< "Failed to retrieve camera info controls";
|
||||
@@ -1095,7 +1099,7 @@ const ControlInfoMap &CameraSensorRaw::controls() const
|
||||
return subdev_->controls();
|
||||
}
|
||||
|
||||
ControlList CameraSensorRaw::getControls(const std::vector<uint32_t> &ids)
|
||||
ControlList CameraSensorRaw::getControls(Span<const uint32_t> ids)
|
||||
{
|
||||
return subdev_->getControls(ids);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user