[libcamera-devel] [PATCH 0/4] Switch RaspberryPi IPA to use std::chrono::duration

Naushir Patuck naush at raspberrypi.com
Tue May 18 12:07:02 CEST 2021


Hi,

Here is an attempt at switching all time based variables in our IPA/Controller
to use std::chrono::duration.  This change makes things much less error prone
when converting time bases or performing arithmetic on various time based
variables.  It also makes things quite neat when defining time duration defaults.

Patch 1 provides some simple helpers for using std::chrono::duration.  Patches
2-4 do the conversion in stages.  Because of the nature of this conversion,
some of the changes in earlier patches get reverted back once all the conversions
have been completed.

Thanks,
Naush

Naushir Patuck (4):
  ipa: raspberrypi: Add helper macros for std::chrono::duration
  ipa: raspberrypi: Switch ipa/cam_helper to use RPiController::Duration
  ipa: raspberrypi: Switch AgcAlgorithm API to use
    RPiController::Duration
  ipa: raspberrypi: Switch the AGC/Lux code to use
    RPiController::Duration

 src/ipa/raspberrypi/cam_helper.cpp            | 17 ++--
 src/ipa/raspberrypi/cam_helper.hpp            | 10 ++-
 .../raspberrypi/controller/agc_algorithm.hpp  |  7 +-
 src/ipa/raspberrypi/controller/agc_status.h   | 12 +--
 src/ipa/raspberrypi/controller/camera_mode.h  |  5 +-
 .../raspberrypi/controller/device_status.h    |  6 +-
 src/ipa/raspberrypi/controller/duration.hpp   | 33 +++++++
 src/ipa/raspberrypi/controller/rpi/agc.cpp    | 89 ++++++++++---------
 src/ipa/raspberrypi/controller/rpi/agc.hpp    | 32 +++----
 src/ipa/raspberrypi/controller/rpi/lux.cpp    | 17 ++--
 src/ipa/raspberrypi/controller/rpi/lux.hpp    |  2 +-
 src/ipa/raspberrypi/raspberrypi.cpp           | 72 ++++++++-------
 12 files changed, 181 insertions(+), 121 deletions(-)
 create mode 100644 src/ipa/raspberrypi/controller/duration.hpp

-- 
2.25.1



More information about the libcamera-devel mailing list