From 3030ffc9f21ce5ed3a160d514c94417a1dabf397 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 9 Oct 2024 13:08:56 +0200 Subject: rkisp1: Export buffers from main and self paths Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 42961c12..83ac666c 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -200,6 +200,11 @@ private: std::queue availableParamBuffers_; std::queue availableStatBuffers_; + std::vector> mainPathBuffers_; + std::vector> selfPathBuffers_; + std::queue availableMainPathBuffers_; + std::queue availableSelfPathBuffers_; + Camera *activeCamera_; const MediaPad *ispSink_; @@ -901,11 +906,30 @@ int PipelineHandlerRkISP1::allocateBuffers(Camera *camera) data->ipa_->mapBuffers(data->ipaBuffers_); + /* Allocate scratch buffers for the two output video devices. */ + ret = mainPath_.exportBuffers(maxCount, &mainPathBuffers_); + if (ret < 0) + goto error; + + for (std::unique_ptr &buffer : mainPathBuffers_) + availableMainPathBuffers_.push(buffer.get()); + + if (hasSelfPath_) { + ret = selfPath_.exportBuffers(maxCount, &selfPathBuffers_); + if (ret < 0) + goto error; + + for (std::unique_ptr &buffer : selfPathBuffers_) + availableSelfPathBuffers_.push(buffer.get()); + } + return 0; error: paramBuffers_.clear(); statBuffers_.clear(); + mainPathBuffers_.clear(); + selfPathBuffers_.clear(); return ret; } -- cgit v1.2.1