diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-06-11 16:30:25 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-05 14:11:11 +0100 |
commit | c5b655fe6f93b01de6070b2fe7be93bab0d39058 (patch) | |
tree | b8a24c42147bb71c1060e0637157be08a2722909 | |
parent | afb2b5856d11f4658d9918547c20525b81490334 (diff) |
DNI: Measure FPS between frames
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r-- | ipu3.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |