[libcamera-devel] [PATCH] ipa: rpi: vc4: Make the StatisticsPtr construction clearer

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Sep 4 18:58:58 CEST 2023


Quoting David Plowman via libcamera-devel (2023-07-28 13:49:07)
> StatisticsPtr is a shared pointer, so the use of std::make_unique to
> create it was a bit confusing. Use std::make_shared instead.
> 
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>

Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

> ---
>  src/ipa/rpi/vc4/vc4.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp
> index 789a345f..3eea40a6 100644
> --- a/src/ipa/rpi/vc4/vc4.cpp
> +++ b/src/ipa/rpi/vc4/vc4.cpp
> @@ -191,7 +191,7 @@ RPiController::StatisticsPtr IpaVc4::platformProcessStats(Span<uint8_t> mem)
>         using namespace RPiController;
>  
>         const bcm2835_isp_stats *stats = reinterpret_cast<bcm2835_isp_stats *>(mem.data());
> -       StatisticsPtr statistics = std::make_unique<Statistics>(Statistics::AgcStatsPos::PreWb,
> +       StatisticsPtr statistics = std::make_shared<Statistics>(Statistics::AgcStatsPos::PreWb,
>                                                                 Statistics::ColourStatsPos::PostLsc);
>         const Controller::HardwareConfig &hw = controller_.getHardwareConfig();
>         unsigned int i;
> -- 
> 2.30.2
>


More information about the libcamera-devel mailing list