diff options
author | Umang Jain <umang.jain@ideasonboard.com> | 2021-08-17 12:29:58 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2021-08-17 12:30:00 +0530 |
commit | c0417c4d524ca6c5421c3491bb95af1aabe0d067 (patch) | |
tree | 89f59fd583456f26bcad34d7fd2bdd126863f51a | |
parent | cb63fc75fb27e5704020f6f5760aa8c4db728c6f (diff) |
pipeline: ipu3: Skip recording timestamp for cancelled buffers
There is no point in recording sensor's timestamp when V4L2VideoDevice
has marked the frame buffers with FrameMetadata::FrameCancelled
(happens when the streams are stopped). The metadata is mostly invalid
for cancelled buffers hence, setting timestamp on invalid metadata
does not make sense (however some metadata can be considered valid
for e.g. returning cause of failure through metadata on cancelled
buffers).
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | src/libcamera/pipeline/ipu3/ipu3.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index e4d44b4d..a98d7eff 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -1318,15 +1318,6 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) Request *request = info->request; - /* - * Record the sensor's timestamp in the request metadata. - * - * \todo The sensor timestamp should be better estimated by connecting - * to the V4L2Device::frameStart signal. - */ - request->metadata().set(controls::SensorTimestamp, - buffer->metadata().timestamp); - /* If the buffer is cancelled force a complete of the whole request. */ if (buffer->metadata().status == FrameMetadata::FrameCancelled) { for (auto it : request->buffers()) { @@ -1340,6 +1331,15 @@ void IPU3CameraData::cio2BufferReady(FrameBuffer *buffer) return; } + /* + * Record the sensor's timestamp in the request metadata. + * + * \todo The sensor timestamp should be better estimated by connecting + * to the V4L2Device::frameStart signal. + */ + request->metadata().set(controls::SensorTimestamp, + buffer->metadata().timestamp); + if (request->findBuffer(&rawStream_)) pipe()->completeBuffer(request, buffer); |