[PATCH 1/3] libcamera: rkisp1: Use const reference for sensor configuration

Stefan Klug stefan.klug at ideasonboard.com
Tue Oct 15 20:19:17 CEST 2024


On Fri, Oct 11, 2024 at 02:52:20PM +0530, Umang Jain wrote:
> User-provided sensor configuration is never meant to be altered,
> hence pass SensorConfiguration by `const` reference in
> RkISP1Path::validate().
> 
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>

Reviewed-by: Stefan Klug <stefan.klug at ideasonboard.com> 

> ---
>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 +-
>  src/libcamera/pipeline/rkisp1/rkisp1_path.h   | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> index 1999094e..4a3b779c 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
> @@ -253,7 +253,7 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size,
>  
>  CameraConfiguration::Status
>  RkISP1Path::validate(const CameraSensor *sensor,
> -		     std::optional<SensorConfiguration> &sensorConfig,
> +		     const std::optional<SensorConfiguration> &sensorConfig,
>  		     StreamConfiguration *cfg)
>  {
>  	const std::vector<unsigned int> &mbusCodes = sensor->mbusCodes();
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> index ce9a5666..8461071f 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h
> @@ -45,7 +45,7 @@ public:
>  						  const Size &resolution,
>  						  StreamRole role);
>  	CameraConfiguration::Status validate(const CameraSensor *sensor,
> -					     std::optional<SensorConfiguration> &sensorConfig,
> +					     const std::optional<SensorConfiguration> &sensorConfig,
>  					     StreamConfiguration *cfg);
>  
>  	int configure(const StreamConfiguration &config,
> -- 
> 2.45.2
> 


More information about the libcamera-devel mailing list