libcamera: Standardize on 'const auto'
'const auto' and 'auto const' are interchangeable in C++. There are 446 occurrences of the former in the code base, and 67 occurrences of the latter. Standardize on the winner. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
This commit is contained in:
@@ -48,7 +48,7 @@ std::vector<StreamRole> StreamKeyValueParser::roles(const OptionValue &values)
|
||||
const std::vector<OptionValue> &streamParameters = values.toArray();
|
||||
|
||||
std::vector<StreamRole> roles;
|
||||
for (auto const &value : streamParameters) {
|
||||
for (const auto &value : streamParameters) {
|
||||
/* If a role is invalid default it to viewfinder. */
|
||||
roles.push_back(parseRole(value.toKeyValues()).value_or(StreamRole::Viewfinder));
|
||||
}
|
||||
@@ -81,7 +81,7 @@ int StreamKeyValueParser::updateConfiguration(CameraConfiguration *config,
|
||||
}
|
||||
|
||||
unsigned int i = 0;
|
||||
for (auto const &value : streamParameters) {
|
||||
for (const auto &value : streamParameters) {
|
||||
KeyValueParser::Options opts = value.toKeyValues();
|
||||
StreamConfiguration &cfg = config->at(i++);
|
||||
|
||||
|
||||
@@ -493,7 +493,7 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,
|
||||
/* Update the IPASessionConfiguration using the sensor settings. */
|
||||
updateSessionConfiguration(sensorCtrls_);
|
||||
|
||||
for (auto const &algo : algorithms()) {
|
||||
for (const auto &algo : algorithms()) {
|
||||
int ret = algo->configure(context_, configInfo);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -563,7 +563,7 @@ void IPAIPU3::computeParams(const uint32_t frame, const uint32_t bufferId)
|
||||
|
||||
IPAFrameContext &frameContext = context_.frameContexts.get(frame);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->prepare(context_, frame, frameContext, params);
|
||||
|
||||
paramsComputed.emit(frame);
|
||||
@@ -601,7 +601,7 @@ void IPAIPU3::processStats(const uint32_t frame,
|
||||
|
||||
ControlList metadata(controls::controls);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->process(context_, frame, frameContext, stats, metadata);
|
||||
|
||||
setControls(frame);
|
||||
@@ -629,7 +629,7 @@ void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls)
|
||||
{
|
||||
IPAFrameContext &frameContext = context_.frameContexts.alloc(frame);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->queueRequest(context_, frame, frameContext, controls);
|
||||
}
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@ int IPAMaliC55::configure(const IPAConfigInfo &ipaConfig, uint8_t bayerOrder,
|
||||
static_cast<BayerFormat::Order>(bayerOrder));
|
||||
updateControls(info, ipaConfig.sensorControls, ipaControls);
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
|
||||
int ret = algo->configure(context_, info);
|
||||
@@ -324,7 +324,7 @@ void IPAMaliC55::queueRequest(const uint32_t request, const ControlList &control
|
||||
{
|
||||
IPAFrameContext &frameContext = context_.frameContexts.alloc(request);
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
|
||||
algo->queueRequest(context_, request, frameContext, controls);
|
||||
@@ -337,7 +337,7 @@ void IPAMaliC55::fillParams(unsigned int request,
|
||||
IPAFrameContext &frameContext = context_.frameContexts.get(request);
|
||||
MaliC55Params params(buffers_.at(bufferId).planes()[0]);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->prepare(context_, request, frameContext, ¶ms);
|
||||
|
||||
paramsComputed.emit(request, params.bytesused());
|
||||
@@ -359,7 +359,7 @@ void IPAMaliC55::processStats(unsigned int request, unsigned int bufferId,
|
||||
|
||||
ControlList metadata(controls::controls);
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
|
||||
algo->process(context_, request, frameContext, stats, metadata);
|
||||
|
||||
@@ -280,7 +280,7 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,
|
||||
return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;
|
||||
});
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
|
||||
/* Disable algorithms that don't support raw formats. */
|
||||
@@ -331,7 +331,7 @@ void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls)
|
||||
IPAFrameContext &frameContext = context_.frameContexts.alloc(frame);
|
||||
context_.debugMetadata.enableByControl(controls);
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
if (algo->disabled_)
|
||||
continue;
|
||||
@@ -346,7 +346,7 @@ void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId)
|
||||
RkISP1Params params(context_.configuration.paramFormat,
|
||||
mappedBuffers_.at(bufferId).planes()[0]);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->prepare(context_, frame, frameContext, ¶ms);
|
||||
|
||||
paramsComputed.emit(frame, params.bytesused());
|
||||
@@ -373,7 +373,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,
|
||||
|
||||
ControlList metadata(controls::controls);
|
||||
|
||||
for (auto const &a : algorithms()) {
|
||||
for (const auto &a : algorithms()) {
|
||||
Algorithm *algo = static_cast<Algorithm *>(a.get());
|
||||
if (algo->disabled_)
|
||||
continue;
|
||||
|
||||
@@ -924,7 +924,7 @@ void IpaBase::applyControls(const ControlList &controls)
|
||||
} while (false);
|
||||
|
||||
/* Iterate over controls */
|
||||
for (auto const &ctrl : controls) {
|
||||
for (const auto &ctrl : controls) {
|
||||
LOG(IPARPI, Debug) << "Request ctrl: "
|
||||
<< controls::controls.at(ctrl.first)->name()
|
||||
<< " = " << ctrl.second.toString();
|
||||
@@ -1627,7 +1627,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)
|
||||
const HdrStatus &hdrStatus = agcStatus ? agcStatus->hdr : hdrStatus_;
|
||||
if (!hdrStatus.mode.empty() && hdrStatus.mode != "Off") {
|
||||
int32_t hdrMode = controls::HdrModeOff;
|
||||
for (auto const &[mode, name] : HdrModeTable) {
|
||||
for (const auto &[mode, name] : HdrModeTable) {
|
||||
if (hdrStatus.mode == name) {
|
||||
hdrMode = mode;
|
||||
break;
|
||||
|
||||
@@ -114,7 +114,7 @@ int Controller::read(char const *filename)
|
||||
<< "This format of the tuning file will be deprecated soon!"
|
||||
<< " Please use the convert_tuning.py utility to update to version 2.0.";
|
||||
|
||||
for (auto const &[key, value] : root->asDict()) {
|
||||
for (const auto &[key, value] : root->asDict()) {
|
||||
int ret = createAlgorithm(key, value);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -127,8 +127,8 @@ int Controller::read(char const *filename)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (auto const &rootAlgo : (*root)["algorithms"].asList())
|
||||
for (auto const &[key, value] : rootAlgo.asDict()) {
|
||||
for (const auto &rootAlgo : (*root)["algorithms"].asList())
|
||||
for (const auto &[key, value] : rootAlgo.asDict()) {
|
||||
int ret = createAlgorithm(key, value);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@@ -298,7 +298,7 @@ int AgcChannel::read(const libcamera::YamlObject ¶ms,
|
||||
return ret;
|
||||
|
||||
const Size &size = hardwareConfig.agcZoneWeights;
|
||||
for (auto const &modes : config_.meteringModes) {
|
||||
for (const auto &modes : config_.meteringModes) {
|
||||
if (modes.second.weights.size() != size.width * size.height) {
|
||||
LOG(RPiAgc, Error) << "AgcMeteringMode: Incorrect number of weights";
|
||||
return -EINVAL;
|
||||
|
||||
@@ -90,7 +90,7 @@ void Lux::process(StatisticsPtr &stats, Metadata *imageMetadata)
|
||||
* is a better choice than the Y-histogram, for example, because it's invariant
|
||||
* to the metering mode (and cheaper to evaluate).
|
||||
*/
|
||||
auto const &fullImageStats = stats->agcRegions.getFloating(0);
|
||||
const auto &fullImageStats = stats->agcRegions.getFloating(0);
|
||||
double currentY = static_cast<double>(fullImageStats.val.ySum) / fullImageStats.counted;
|
||||
|
||||
double currentGain = deviceStatus.analogueGain;
|
||||
|
||||
@@ -553,7 +553,7 @@ RPiController::StatisticsPtr IpaPiSP::platformProcessStats(Span<uint8_t> mem)
|
||||
|
||||
void IpaPiSP::handleControls(const ControlList &controls)
|
||||
{
|
||||
for (auto const &ctrl : controls) {
|
||||
for (const auto &ctrl : controls) {
|
||||
switch (ctrl.first) {
|
||||
case controls::HDR_MODE:
|
||||
case controls::AE_METERING_MODE:
|
||||
|
||||
@@ -300,7 +300,7 @@ void IpaVc4::handleControls(const ControlList &controls)
|
||||
{ controls::draft::NoiseReductionModeZSL, RPiController::DenoiseMode::ColourHighQuality },
|
||||
};
|
||||
|
||||
for (auto const &ctrl : controls) {
|
||||
for (const auto &ctrl : controls) {
|
||||
switch (ctrl.first) {
|
||||
case controls::draft::NOISE_REDUCTION_MODE: {
|
||||
RPiController::DenoiseAlgorithm *sdn = dynamic_cast<RPiController::DenoiseAlgorithm *>(
|
||||
|
||||
@@ -249,7 +249,7 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)
|
||||
context_.configuration.agc.againMinStep = 1.0;
|
||||
}
|
||||
|
||||
for (auto const &algo : algorithms()) {
|
||||
for (const auto &algo : algorithms()) {
|
||||
int ret = algo->configure(context_, configInfo);
|
||||
if (ret)
|
||||
return ret;
|
||||
@@ -279,7 +279,7 @@ void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &contro
|
||||
{
|
||||
IPAFrameContext &frameContext = context_.frameContexts.alloc(frame);
|
||||
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->queueRequest(context_, frame, frameContext, controls);
|
||||
}
|
||||
|
||||
@@ -288,7 +288,7 @@ void IPASoftSimple::computeParams(const uint32_t frame)
|
||||
context_.activeState.combinedMatrix = Matrix<float, 3, 3>::identity();
|
||||
|
||||
IPAFrameContext &frameContext = context_.frameContexts.get(frame);
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->prepare(context_, frame, frameContext, params_);
|
||||
params_->combinedMatrix = context_.activeState.combinedMatrix;
|
||||
|
||||
@@ -307,7 +307,7 @@ void IPASoftSimple::processStats(const uint32_t frame,
|
||||
frameContext.sensor.gain = camHelper_ ? camHelper_->gain(again) : again;
|
||||
|
||||
ControlList metadata(controls::controls);
|
||||
for (auto const &algo : algorithms())
|
||||
for (const auto &algo : algorithms())
|
||||
algo->process(context_, frame, frameContext, stats_, metadata);
|
||||
metadataReady.emit(frame, metadata);
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ DelayedControls::DelayedControls(V4L2Device *device,
|
||||
* Create a map of control ids to delays for controls exposed by the
|
||||
* device.
|
||||
*/
|
||||
for (auto const ¶m : controlParams) {
|
||||
for (const auto ¶m : controlParams) {
|
||||
auto it = controls.find(param.first);
|
||||
if (it == controls.end()) {
|
||||
LOG(DelayedControls, Error)
|
||||
@@ -120,7 +120,7 @@ void DelayedControls::reset()
|
||||
|
||||
/* Retrieve control as reported by the device. */
|
||||
std::vector<uint32_t> ids;
|
||||
for (auto const ¶m : controlParams_)
|
||||
for (const auto ¶m : controlParams_)
|
||||
ids.push_back(param.first->id());
|
||||
|
||||
ControlList controls = device_->getControls(ids);
|
||||
|
||||
@@ -589,7 +589,7 @@ bool MediaDevice::addObject(MediaObject *object)
|
||||
*/
|
||||
void MediaDevice::clear()
|
||||
{
|
||||
for (auto const &o : objects_)
|
||||
for (const auto &o : objects_)
|
||||
delete o.second;
|
||||
|
||||
objects_.clear();
|
||||
|
||||
@@ -318,7 +318,7 @@ void MaliC55CameraData::updateControls(const ControlInfoMap &ipaControls)
|
||||
ControlInfo(ispMinCrop, sensorInfo.analogCrop,
|
||||
sensorInfo.analogCrop);
|
||||
|
||||
for (auto const &c : ipaControls)
|
||||
for (const auto &c : ipaControls)
|
||||
controls.emplace(c.first, c.second);
|
||||
|
||||
controlInfo_ = ControlInfoMap(std::move(controls), controls::controls);
|
||||
|
||||
@@ -85,7 +85,7 @@ DelayedControls::DelayedControls(V4L2Device *device,
|
||||
* Create a map of control ids to delays for controls exposed by the
|
||||
* device.
|
||||
*/
|
||||
for (auto const ¶m : controlParams) {
|
||||
for (const auto ¶m : controlParams) {
|
||||
auto it = controls.find(param.first);
|
||||
if (it == controls.end()) {
|
||||
LOG(RPiDelayedControls, Error)
|
||||
@@ -125,7 +125,7 @@ void DelayedControls::reset(unsigned int cookie)
|
||||
|
||||
/* Retrieve control as reported by the device. */
|
||||
std::vector<uint32_t> ids;
|
||||
for (auto const ¶m : controlParams_)
|
||||
for (const auto ¶m : controlParams_)
|
||||
ids.push_back(param.first->id());
|
||||
|
||||
ControlList controls = device_->getControls(ids);
|
||||
|
||||
@@ -508,7 +508,7 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)
|
||||
|
||||
/* Start by freeing all buffers and reset the stream states. */
|
||||
data->freeBuffers();
|
||||
for (auto const stream : data->streams_)
|
||||
for (const auto stream : data->streams_)
|
||||
stream->clearFlags(StreamFlag::External);
|
||||
|
||||
/*
|
||||
@@ -561,7 +561,7 @@ int PipelineHandlerBase::configure(Camera *camera, CameraConfiguration *config)
|
||||
|
||||
/* Update the controls that the Raspberry Pi IPA can handle. */
|
||||
ControlInfoMap::Map ctrlMap;
|
||||
for (auto const &c : result.controlInfo)
|
||||
for (const auto &c : result.controlInfo)
|
||||
ctrlMap.emplace(c.first, c.second);
|
||||
|
||||
const auto cropParamsIt = data->cropParams_.find(0);
|
||||
@@ -663,7 +663,7 @@ int PipelineHandlerBase::start(Camera *camera, const ControlList *controls)
|
||||
data->startupFrameCount_ = result.startupFrameCount;
|
||||
data->invalidFrameCount_ = result.invalidFrameCount;
|
||||
|
||||
for (auto const stream : data->streams_)
|
||||
for (const auto stream : data->streams_)
|
||||
stream->resetBuffers();
|
||||
|
||||
if (!data->buffersAllocated_) {
|
||||
@@ -701,7 +701,7 @@ int PipelineHandlerBase::start(Camera *camera, const ControlList *controls)
|
||||
data->platformStart();
|
||||
|
||||
/* Start all streams. */
|
||||
for (auto const stream : data->streams_) {
|
||||
for (const auto stream : data->streams_) {
|
||||
ret = stream->dev()->streamOn();
|
||||
if (ret) {
|
||||
stop(camera);
|
||||
@@ -719,7 +719,7 @@ void PipelineHandlerBase::stopDevice(Camera *camera)
|
||||
data->state_ = CameraData::State::Stopped;
|
||||
data->platformStop();
|
||||
|
||||
for (auto const stream : data->streams_) {
|
||||
for (const auto stream : data->streams_) {
|
||||
stream->dev()->streamOff();
|
||||
stream->dev()->releaseBuffers();
|
||||
}
|
||||
@@ -801,7 +801,7 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera
|
||||
return -EINVAL;
|
||||
|
||||
/* Populate the map of sensor supported formats and sizes. */
|
||||
for (auto const mbusCode : data->sensor_->mbusCodes())
|
||||
for (const auto mbusCode : data->sensor_->mbusCodes())
|
||||
data->sensorFormats_.emplace(mbusCode,
|
||||
data->sensor_->sizes(mbusCode));
|
||||
|
||||
@@ -886,7 +886,7 @@ void PipelineHandlerBase::mapBuffers(Camera *camera, const BufferMap &buffers, u
|
||||
* This will allow us to identify buffers passed between the pipeline
|
||||
* handler and the IPA.
|
||||
*/
|
||||
for (auto const &[id, buffer] : buffers) {
|
||||
for (const auto &[id, buffer] : buffers) {
|
||||
Span<const FrameBuffer::Plane> planes = buffer.buffer->planes();
|
||||
|
||||
bufferIds.emplace_back(mask | id,
|
||||
@@ -902,7 +902,7 @@ int PipelineHandlerBase::queueAllBuffers(Camera *camera)
|
||||
CameraData *data = cameraData(camera);
|
||||
int ret;
|
||||
|
||||
for (auto const stream : data->streams_) {
|
||||
for (const auto stream : data->streams_) {
|
||||
ret = stream->dev()->importBuffers(VIDEO_MAX_FRAME);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -987,7 +987,7 @@ void CameraData::freeBuffers()
|
||||
bufferIds_.clear();
|
||||
}
|
||||
|
||||
for (auto const stream : streams_)
|
||||
for (const auto stream : streams_)
|
||||
stream->releaseBuffers();
|
||||
|
||||
platformFreeBuffers();
|
||||
@@ -1322,7 +1322,7 @@ void CameraData::applyScalerCrop(const ControlList &controls)
|
||||
scalerCrops.push_back(*scalerCropCore);
|
||||
}
|
||||
|
||||
for (auto const &[i, scalerCrop] : utils::enumerate(scalerCrops)) {
|
||||
for (const auto &[i, scalerCrop] : utils::enumerate(scalerCrops)) {
|
||||
Rectangle nativeCrop = scalerCrop;
|
||||
|
||||
if (!nativeCrop.width || !nativeCrop.height)
|
||||
@@ -1364,7 +1364,7 @@ void CameraData::cameraTimeout()
|
||||
* stop all devices streaming, and return any outstanding requests as
|
||||
* incomplete and cancelled.
|
||||
*/
|
||||
for (auto const stream : streams_)
|
||||
for (const auto stream : streams_)
|
||||
stream->dev()->streamOff();
|
||||
|
||||
clearIncompleteRequests();
|
||||
@@ -1504,7 +1504,7 @@ void CameraData::fillRequestMetadata(const ControlList &bufferControls, Request
|
||||
if (cropParams_.size()) {
|
||||
std::vector<Rectangle> crops;
|
||||
|
||||
for (auto const &[k, v] : cropParams_)
|
||||
for (const auto &[k, v] : cropParams_)
|
||||
crops.push_back(scaleIspCrop(v.ispCrop));
|
||||
|
||||
request->_d()->metadata().set(controls::ScalerCrop, crops[0]);
|
||||
|
||||
@@ -68,13 +68,13 @@ void Stream::resetBuffers()
|
||||
{
|
||||
/* Add all internal buffers to the queue of usable buffers. */
|
||||
availableBuffers_ = {};
|
||||
for (auto const &buffer : internalBuffers_)
|
||||
for (const auto &buffer : internalBuffers_)
|
||||
availableBuffers_.push(buffer.get());
|
||||
}
|
||||
|
||||
void Stream::setExportedBuffers(std::vector<std::unique_ptr<FrameBuffer>> *buffers)
|
||||
{
|
||||
for (auto const &buffer : *buffers)
|
||||
for (const auto &buffer : *buffers)
|
||||
bufferEmplace(++id_, buffer.get());
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ unsigned int Stream::getBufferId(FrameBuffer *buffer) const
|
||||
|
||||
/* Find the buffer in the map, and return the buffer id. */
|
||||
auto it = std::find_if(bufferMap_.begin(), bufferMap_.end(),
|
||||
[&buffer](auto const &p) { return p.second.buffer == buffer; });
|
||||
[&buffer](const auto &p) { return p.second.buffer == buffer; });
|
||||
|
||||
if (it == bufferMap_.end())
|
||||
return 0;
|
||||
@@ -201,7 +201,7 @@ void Stream::returnBuffer(FrameBuffer *buffer)
|
||||
|
||||
const BufferObject &Stream::getBuffer(unsigned int id)
|
||||
{
|
||||
auto const &it = bufferMap_.find(id);
|
||||
const auto &it = bufferMap_.find(id);
|
||||
if (it == bufferMap_.end())
|
||||
return errorBufferObject;
|
||||
|
||||
|
||||
@@ -972,7 +972,7 @@ int PipelineHandlerPiSP::allocateBuffers(Camera *camera)
|
||||
}
|
||||
|
||||
/* Decide how many internal buffers to allocate. */
|
||||
for (auto const stream : data->streams_) {
|
||||
for (const auto stream : data->streams_) {
|
||||
unsigned int numBuffers;
|
||||
/*
|
||||
* For CFE, allocate a minimum of 4 buffers as we want
|
||||
@@ -1036,12 +1036,12 @@ int PipelineHandlerPiSP::allocateBuffers(Camera *camera)
|
||||
pisp_image_format_config tdn;
|
||||
data->be_->GetTdnOutputFormat(tdn);
|
||||
unsigned int size = tdn.stride * tdn.height;
|
||||
for (auto const &buffer : data->isp_[Isp::TdnOutput].getBuffers()) {
|
||||
for (const auto &buffer : data->isp_[Isp::TdnOutput].getBuffers()) {
|
||||
FrameBuffer *b = buffer.second.buffer;
|
||||
b->_d()->metadata().planes()[0].bytesused = size;
|
||||
data->tdnBuffers_.push_back(b);
|
||||
}
|
||||
for (auto const &buffer : data->isp_[Isp::StitchOutput].getBuffers()) {
|
||||
for (const auto &buffer : data->isp_[Isp::StitchOutput].getBuffers()) {
|
||||
FrameBuffer *b = buffer.second.buffer;
|
||||
b->_d()->metadata().planes()[0].bytesused = size;
|
||||
data->stitchBuffers_.push_back(b);
|
||||
|
||||
@@ -233,7 +233,7 @@ int PipelineHandlerVc4::allocateBuffers(Camera *camera)
|
||||
}
|
||||
|
||||
/* Decide how many internal buffers to allocate. */
|
||||
for (auto const stream : data->streams_) {
|
||||
for (const auto stream : data->streams_) {
|
||||
unsigned int numBuffers;
|
||||
/*
|
||||
* For Unicam, allocate a minimum number of buffers for internal
|
||||
|
||||
@@ -136,7 +136,7 @@ VirtualCameraData::VirtualCameraData(PipelineHandler *pipe,
|
||||
|
||||
void VirtualCameraData::processRequest(Request *request)
|
||||
{
|
||||
for (auto const &[stream, buffer] : request->buffers()) {
|
||||
for (const auto &[stream, buffer] : request->buffers()) {
|
||||
bool found = false;
|
||||
/* map buffer and fill test patterns */
|
||||
for (auto &streamConfig : streamConfigs_) {
|
||||
|
||||
@@ -194,7 +194,7 @@ std::vector<Size> StreamFormats::sizes(const PixelFormat &pixelformat) const
|
||||
std::vector<Size> sizes;
|
||||
|
||||
/* Make sure pixel format exists. */
|
||||
auto const &it = formats_.find(pixelformat);
|
||||
const auto &it = formats_.find(pixelformat);
|
||||
if (it == formats_.end())
|
||||
return {};
|
||||
|
||||
@@ -243,7 +243,7 @@ std::vector<Size> StreamFormats::sizes(const PixelFormat &pixelformat) const
|
||||
*/
|
||||
SizeRange StreamFormats::range(const PixelFormat &pixelformat) const
|
||||
{
|
||||
auto const it = formats_.find(pixelformat);
|
||||
const auto it = formats_.find(pixelformat);
|
||||
if (it == formats_.end())
|
||||
return {};
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ V4L2BufferCache::~V4L2BufferCache()
|
||||
*/
|
||||
bool V4L2BufferCache::isEmpty() const
|
||||
{
|
||||
for (auto const &entry : cache_) {
|
||||
for (const auto &entry : cache_) {
|
||||
if (!entry.free_)
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user