diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-06-11 16:52:51 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-04 11:20:37 +0100 |
commit | 9fb102d5e2176c70b9d09cb4095acf1f5f879a8f (patch) | |
tree | 5dfa16e2781cb78b31106da6193e3a4714093077 /src | |
parent | c6f2d537ad3082449c7c38885e44d00af74cef48 (diff) |
DNI: Measure CIO2 Frame rate and sequences
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/ipu3/ipu3.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 76c3bb3d..f677653b 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1325,6 +1325,16 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) request->metadata().set(controls::SensorTimestamp, buffer->metadata().timestamp); + static uint64_t lastFrameTimestamp = 0; + + double fps = buffer->metadata().timestamp - lastFrameTimestamp; + fps = lastFrameTimestamp != 0 && fps ? 1000000000.0 / fps : 0.0; + lastFrameTimestamp = buffer->metadata().timestamp; + + LOG(IPU3, Info) + << "CIO2 Complete: Frame " << buffer->metadata().sequence + << ": fps " << fps; + /* If the buffer is cancelled force a complete of the whole request. */ if (buffer->metadata().status == FrameMetadata::FrameCancelled) { for (auto it : request->buffers()) { |