From 4383252d9315b3a282d220f30ac1a5594cd66d7c Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sun, 28 Jun 2020 18:37:26 +0200 Subject: libcamera: ipu3: Rename mbusCodesToInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The mbusCodesToInfo map actually maps media bus codes to PixelFormat instances. Rename the map according to its actual function and while at it drop the 'static' keyword as the map is already defined in an anonymous namespace. Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/ipu3/cio2.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index cb8c80a4..77f54da4 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -22,7 +22,7 @@ LOG_DECLARE_CATEGORY(IPU3) namespace { -static const std::map mbusCodesToInfo = { +const std::map mbusCodesToPixelFormat = { { MEDIA_BUS_FMT_SBGGR10_1X10, formats::SBGGR10_IPU3 }, { MEDIA_BUS_FMT_SGBRG10_1X10, formats::SGBRG10_IPU3 }, { MEDIA_BUS_FMT_SGRBG10_1X10, formats::SGRBG10_IPU3 }, @@ -94,7 +94,7 @@ int CIO2Device::init(const MediaDevice *media, unsigned int index) * utils::set_overlap requires the ranges to be sorted, keep the * cio2Codes vector sorted in ascending order. */ - std::vector cio2Codes = utils::map_keys(mbusCodesToInfo); + std::vector cio2Codes = utils::map_keys(mbusCodesToPixelFormat); const std::vector &sensorCodes = sensor_->mbusCodes(); if (!utils::set_overlap(sensorCodes.begin(), sensorCodes.end(), cio2Codes.begin(), cio2Codes.end())) { @@ -134,7 +134,7 @@ int CIO2Device::configure(const Size &size, V4L2DeviceFormat *outputFormat) * Apply the selected format to the sensor, the CSI-2 receiver and * the CIO2 output device. */ - std::vector mbusCodes = utils::map_keys(mbusCodesToInfo); + std::vector mbusCodes = utils::map_keys(mbusCodesToPixelFormat); sensorFormat = sensor_->getFormat(mbusCodes, size); ret = sensor_->setFormat(&sensorFormat); if (ret) @@ -144,8 +144,8 @@ int CIO2Device::configure(const Size &size, V4L2DeviceFormat *outputFormat) if (ret) return ret; - const auto &itInfo = mbusCodesToInfo.find(sensorFormat.mbus_code); - if (itInfo == mbusCodesToInfo.end()) + const auto &itInfo = mbusCodesToPixelFormat.find(sensorFormat.mbus_code); + if (itInfo == mbusCodesToPixelFormat.end()) return -EINVAL; const PixelFormatInfo &info = PixelFormatInfo::info(itInfo->second); @@ -173,7 +173,7 @@ CIO2Device::generateConfiguration(Size size) const size = sensor_->resolution(); /* Query the sensor static information for closest match. */ - std::vector mbusCodes = utils::map_keys(mbusCodesToInfo); + std::vector mbusCodes = utils::map_keys(mbusCodesToPixelFormat); V4L2SubdeviceFormat sensorFormat = sensor_->getFormat(mbusCodes, size); if (!sensorFormat.mbus_code) { LOG(IPU3, Error) << "Sensor does not support mbus code"; @@ -181,7 +181,7 @@ CIO2Device::generateConfiguration(Size size) const } cfg.size = sensorFormat.size; - cfg.pixelFormat = mbusCodesToInfo.at(sensorFormat.mbus_code); + cfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.mbus_code); cfg.bufferCount = CIO2_BUFFER_COUNT; return cfg; -- cgit v1.2.1