[libcamera-devel] [PATCH 1/5] src: ipa: raspberrypi: Distinguish the first camera start from others

David Plowman david.plowman at raspberrypi.com
Wed Dec 2 12:52:49 CET 2020


This makes it possible to tell whether we're starting the sensor for
the first time, or whether it's happening because of a mode switch or
because the camera has been paused and re-started. Depending on this,
some sensors may require us to drop different numbers of frames.

Signed-off-by: David Plowman <david.plowman at raspberrypi.com>
---
 src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp
index 69be5e4e..b8298768 100644
--- a/src/ipa/raspberrypi/raspberrypi.cpp
+++ b/src/ipa/raspberrypi/raspberrypi.cpp
@@ -67,7 +67,7 @@ public:
 	IPARPi()
 		: lastMode_({}), controller_(), controllerInit_(false),
 		  frameCount_(0), checkCount_(0), mistrustCount_(0),
-		  lsTable_(nullptr)
+		  lsTable_(nullptr), firstStart_(true)
 	{
 	}
 
@@ -145,6 +145,9 @@ private:
 	/* LS table allocation passed in from the pipeline handler. */
 	FileDescriptor lsTableHandle_;
 	void *lsTable_;
+
+	/* Distinguish the first camera start from others. */
+	bool firstStart_;
 };
 
 int IPARPi::init(const IPASettings &settings)
@@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result)
 		result->operation |= RPi::IPA_CONFIG_SENSOR;
 	}
 
+	firstStart_ = false;
+
 	return 0;
 }
 
-- 
2.20.1



More information about the libcamera-devel mailing list