diff options
author | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2023-07-12 11:55:08 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo.mondi@ideasonboard.com> | 2023-07-24 11:21:00 +0200 |
commit | 81fa10d87f6a0d639976e67247e0415601e00eaa (patch) | |
tree | 4c12e464cdc98f131267c42ff8e44aacff7f43aa /src | |
parent | baaad1bf9e2acb3ab721945041ef46496951c04c (diff) |
libcamera: rpi: pipeline_base: Remove populateSensorFormats()
populateSensorFormats() is a static helper that is called from a single
place and performs a simple loop over the sensor camera formats.
Remove it and in-line it in the caller to remove one static helper from
the pipeline_base.cpp file.
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp index 179a5b81..fb3756a4 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp @@ -66,16 +66,6 @@ PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code, return pix; } -SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor) -{ - SensorFormats formats; - - for (auto const mbusCode : sensor->mbusCodes()) - formats.emplace(mbusCode, sensor->sizes(mbusCode)); - - return formats; -} - bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor) { unsigned int mbusCode = sensor->mbusCodes()[0]; @@ -804,7 +794,10 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera if (data->sensor_->init()) return -EINVAL; - data->sensorFormats_ = populateSensorFormats(data->sensor_); + /* Populate the map of sensor supported formats and sizes. */ + for (auto const mbusCode : data->sensor_->mbusCodes()) + data->sensorFormats_.emplace(mbusCode, + data->sensor_->sizes(mbusCode)); /* * Enumerate all the Video Mux/Bridge devices across the sensor -> Fr |