[libcamera-devel] [PATCH 2/2] ipa: ipu3: agc: Use existing local short-hand variable in configure()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Mar 15 14:34:07 CET 2022
The configure() function has a local configuration variable referencing
context.configuration for the purpose of shortening lines. Use it
instead of context.configuration in the remaining locations, and
constify it while at it as the configuration isn't meant to be modified.
Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
src/ipa/ipu3/algorithms/agc.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 70cff3fed43c..7d4b3503f390 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -86,17 +86,17 @@ Agc::Agc()
int Agc::configure(IPAContext &context,
[[maybe_unused]] const IPAConfigInfo &configInfo)
{
- IPASessionConfiguration &configuration = context.configuration;
+ const IPASessionConfiguration &configuration = context.configuration;
IPAFrameContext &frameContext = context.frameContext;
stride_ = configuration.grid.stride;
- minShutterSpeed_ = context.configuration.agc.minShutterSpeed;
- maxShutterSpeed_ = std::min(context.configuration.agc.maxShutterSpeed,
+ minShutterSpeed_ = configuration.agc.minShutterSpeed;
+ maxShutterSpeed_ = std::min(configuration.agc.maxShutterSpeed,
kMaxShutterSpeed);
- minAnalogueGain_ = std::max(context.configuration.agc.minAnalogueGain, kMinAnalogueGain);
- maxAnalogueGain_ = std::min(context.configuration.agc.maxAnalogueGain, kMaxAnalogueGain);
+ minAnalogueGain_ = std::max(configuration.agc.minAnalogueGain, kMinAnalogueGain);
+ maxAnalogueGain_ = std::min(configuration.agc.maxAnalogueGain, kMaxAnalogueGain);
/* Configure the default exposure and gain. */
frameContext.agc.gain = std::max(minAnalogueGain_, kMinAnalogueGain);
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list