diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/rkisp1/rkisp1.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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<FrameBuffer *> availableParamBuffers_; std::queue<FrameBuffer *> availableStatBuffers_; + std::vector<std::unique_ptr<FrameBuffer>> mainPathBuffers_; + std::vector<std::unique_ptr<FrameBuffer>> selfPathBuffers_; + std::queue<FrameBuffer *> availableMainPathBuffers_; + std::queue<FrameBuffer *> 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<FrameBuffer> &buffer : mainPathBuffers_) + availableMainPathBuffers_.push(buffer.get()); + + if (hasSelfPath_) { + ret = selfPath_.exportBuffers(maxCount, &selfPathBuffers_); + if (ret < 0) + goto error; + + for (std::unique_ptr<FrameBuffer> &buffer : selfPathBuffers_) + availableSelfPathBuffers_.push(buffer.get()); + } + return 0; error: paramBuffers_.clear(); statBuffers_.clear(); + mainPathBuffers_.clear(); + selfPathBuffers_.clear(); return ret; } |