libcamera: pipeline: Prevent variable shadowing

Remove variable shadowing within the pipeline handler implementations.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2020-07-28 13:34:36 +01:00
parent f4c234579b
commit d3f60c8458
4 changed files with 11 additions and 11 deletions

View file

@ -512,9 +512,9 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,
/* Translate the V4L2PixelFormat to PixelFormat. */ /* Translate the V4L2PixelFormat to PixelFormat. */
std::map<PixelFormat, std::vector<SizeRange>> deviceFormats; std::map<PixelFormat, std::vector<SizeRange>> deviceFormats;
for (const auto &format : fmts) { for (const auto &format : fmts) {
PixelFormat pixelFormat = format.first.toPixelFormat(); PixelFormat pf = format.first.toPixelFormat();
if (pixelFormat.isValid()) if (pf.isValid())
deviceFormats[pixelFormat] = format.second; deviceFormats[pf] = format.second;
} }
/* Add the stream format based on the device node used for the use case. */ /* Add the stream format based on the device node used for the use case. */

View file

@ -72,11 +72,11 @@ std::vector<PixelFormat> SimpleConverter::formats(PixelFormat input)
* Set the format on the input side (V4L2 output) of the converter to * Set the format on the input side (V4L2 output) of the converter to
* enumerate the conversion capabilities on its output (V4L2 capture). * enumerate the conversion capabilities on its output (V4L2 capture).
*/ */
V4L2DeviceFormat format; V4L2DeviceFormat v4l2Format;
format.fourcc = m2m_->output()->toV4L2PixelFormat(input); v4l2Format.fourcc = m2m_->output()->toV4L2PixelFormat(input);
format.size = { 1, 1 }; v4l2Format.size = { 1, 1 };
int ret = m2m_->output()->setFormat(&format); int ret = m2m_->output()->setFormat(&v4l2Format);
if (ret < 0) { if (ret < 0) {
LOG(SimplePipeline, Error) LOG(SimplePipeline, Error)
<< "Failed to set format: " << strerror(-ret); << "Failed to set format: " << strerror(-ret);

View file

@ -314,8 +314,8 @@ int SimpleCameraData::init()
config.outputSizes = converter->sizes(format.size); config.outputSizes = converter->sizes(format.size);
for (PixelFormat format : converter->formats(pixelFormat)) for (PixelFormat fmt : converter->formats(pixelFormat))
formats_[format] = config; formats_[fmt] = config;
} }
} }

View file

@ -490,8 +490,8 @@ int UVCCameraData::init(MediaDevice *media)
/* Locate and initialise the camera data with the default video node. */ /* Locate and initialise the camera data with the default video node. */
const std::vector<MediaEntity *> &entities = media->entities(); const std::vector<MediaEntity *> &entities = media->entities();
auto entity = std::find_if(entities.begin(), entities.end(), auto entity = std::find_if(entities.begin(), entities.end(),
[](MediaEntity *entity) { [](MediaEntity *e) {
return entity->flags() & MEDIA_ENT_FL_DEFAULT; return e->flags() & MEDIA_ENT_FL_DEFAULT;
}); });
if (entity == entities.end()) { if (entity == entities.end()) {
LOG(UVC, Error) << "Could not find a default video device"; LOG(UVC, Error) << "Could not find a default video device";