summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rkisp1/rkisp1.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-12 23:22:57 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-09-28 23:53:45 +0200
commitf65e6b124bc796a7c7282dcb11b8d297432369cf (patch)
tree542be41ae6c542d915f266a17ee1d855ba076828 /src/libcamera/pipeline/rkisp1/rkisp1.cpp
parentfedc77842eccddee89bfc70d614d744d9e6b8c2b (diff)
libcamera: pipeline: rkisp1: Prepare buffer ready handlers for multiple streams
The buffer ready handlers are designed for a single application facing stream from the main path. To prepare for multiple application facing streams from main and/or self path the handlers need to be prepared. The data keeping track of the frame number and advancing the timeline can be moved from the application facing buffer ready handler to the statistics handler. For each request processed there will always be a statistic buffer and as the ISP is inline and is the source of both main, self and statistic paths there is no change in behavior. The application facing handler no longer needs a special case for cancelled frames and can be made simpler. With this change the handlers are ready to deal with any combinations of application facing streams. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/rkisp1/rkisp1.cpp')
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 8bb4582e..d6b5073b 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -1070,20 +1070,8 @@ void PipelineHandlerRkISP1::tryCompleteRequest(Request *request)
void PipelineHandlerRkISP1::bufferReady(FrameBuffer *buffer)
{
ASSERT(activeCamera_);
- RkISP1CameraData *data = cameraData(activeCamera_);
Request *request = buffer->request();
- if (buffer->metadata().status == FrameMetadata::FrameCancelled) {
- completeBuffer(activeCamera_, request, buffer);
- completeRequest(activeCamera_, request);
- return;
- }
-
- data->timeline_.bufferReady(buffer);
-
- if (data->frame_ <= buffer->metadata().sequence)
- data->frame_ = buffer->metadata().sequence + 1;
-
completeBuffer(activeCamera_, request, buffer);
tryCompleteRequest(request);
}
@@ -1114,6 +1102,11 @@ void PipelineHandlerRkISP1::statReady(FrameBuffer *buffer)
if (!info)
return;
+ data->timeline_.bufferReady(buffer);
+
+ if (data->frame_ <= buffer->metadata().sequence)
+ data->frame_ = buffer->metadata().sequence + 1;
+
IPAOperationData op;
op.operation = RKISP1_IPA_EVENT_SIGNAL_STAT_BUFFER;
op.data = { info->frame, info->statBuffer->cookie() };