summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-06-11 16:30:25 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-08-05 14:11:11 +0100
commitc5b655fe6f93b01de6070b2fe7be93bab0d39058 (patch)
treeb8a24c42147bb71c1060e0637157be08a2722909
parentafb2b5856d11f4658d9918547c20525b81490334 (diff)
DNI: Measure FPS between frames
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--ipu3.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipu3.cpp b/ipu3.cpp
index 4fce647..96744c8 100644
--- a/ipu3.cpp
+++ b/ipu3.cpp
@@ -81,6 +81,8 @@ private:
BinaryData aiqb_;
BinaryData nvm_;
BinaryData aiqd_;
+
+ uint64_t lastFrameTimestamp_;
};
int IPAIPU3::init(const IPASettings &settings)
@@ -319,6 +321,12 @@ void IPAIPU3::parseStatistics(unsigned int frame,
(sensorInfo_.pixelRate / 1e6);
ctrls.set(controls::FrameDuration, frameDuration);
+ double fps = frameTimestamp - lastFrameTimestamp_;
+ fps = lastFrameTimestamp_ != 0 && fps ? 1000000000.0 / fps : 0.0;
+ lastFrameTimestamp_ = frameTimestamp;
+
+ LOG(IPAIPU3, Info) << "Frame " << frame << ": fps " << fps;
+
IPU3Action op;
op.op = ActionMetadataReady;
op.controls = ctrls;