[libcamera-devel] [PATCH] libcamera: ipa: raspberrypi: Enable focus measure without recompile

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jul 1 11:11:29 CEST 2020


Hi David,

Thank you for the patch.

On Wed, Jul 01, 2020 at 09:53:56AM +0100, David Plowman wrote:
> Previously output of the focus measure could be enabled without
> recompiling (because of the RPI_LOGGING_ENABLE macro). Here we disable
> it in the imx477 tuning, but if re-enabled there it will now be output
> to the console (much more helpful behaviour).
> 
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
> ---
>  src/ipa/raspberrypi/controller/rpi/focus.cpp | 2 +-
>  src/ipa/raspberrypi/data/imx477.json         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/ipa/raspberrypi/controller/rpi/focus.cpp b/src/ipa/raspberrypi/controller/rpi/focus.cpp
> index 1e2b649..133ea6f 100644
> --- a/src/ipa/raspberrypi/controller/rpi/focus.cpp
> +++ b/src/ipa/raspberrypi/controller/rpi/focus.cpp
> @@ -39,7 +39,7 @@ void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)
>  	image_metadata->Set("focus.status", status);
>  	if (print_) {
>  		uint32_t value = (status.focus_measures[5] + status.focus_measures[6]) / 10;
> -		RPI_LOG("Focus contrast measure: " << value);
> +		std::cout << "Focus contrast measure: " << value << std::endl;

How about using the libcamera logging infrastructure ? It would give you
runtime-controllable log categories and levels.

>  	}
>  }
>  
> diff --git a/src/ipa/raspberrypi/data/imx477.json b/src/ipa/raspberrypi/data/imx477.json
> index 389e8ce..8976e31 100644
> --- a/src/ipa/raspberrypi/data/imx477.json
> +++ b/src/ipa/raspberrypi/data/imx477.json
> @@ -415,6 +415,6 @@
>      },
>      "rpi.focus":
>      {
> -	"print": 1
> +	"print": 0
>      }
>  }

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list