From c2dfdecd056247808a7cb3175df0086cac78ccb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Thu, 24 Sep 2020 23:27:09 +0200 Subject: libcamera: pipeline: rkisp1: Add wrappers for accessing the path video device MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a step to be able to make RkISP1Path::video_ private add simple wrappers for buffer handling. There is no functional change. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 12 ++++++------ src/libcamera/pipeline/rkisp1/rkisp1_path.h | 13 ++++++++++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 86a8fd4f..71d10005 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -403,10 +403,10 @@ protected: pipe_->stat_->queueBuffer(info->statBuffer); if (info->mainPathBuffer) - pipe_->mainPath_.video_->queueBuffer(info->mainPathBuffer); + pipe_->mainPath_.queueBuffer(info->mainPathBuffer); if (info->selfPathBuffer) - pipe_->selfPath_.video_->queueBuffer(info->selfPathBuffer); + pipe_->selfPath_.queueBuffer(info->selfPathBuffer); } private: @@ -752,9 +752,9 @@ int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, S unsigned int count = stream->configuration().bufferCount; if (stream == &data->mainPathStream_) - return mainPath_.video_->exportBuffers(count, buffers); + return mainPath_.exportBuffers(count, buffers); else if (stream == &data->selfPathStream_) - return selfPath_.video_->exportBuffers(count, buffers); + return selfPath_.exportBuffers(count, buffers); return -EINVAL; } @@ -1154,8 +1154,8 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator) if (!selfPath_.init(media_)) return false; - mainPath_.video_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady); - selfPath_.video_->bufferReady.connect(this, &PipelineHandlerRkISP1::bufferReady); + mainPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady); + selfPath_.bufferReady().connect(this, &PipelineHandlerRkISP1::bufferReady); stat_->bufferReady.connect(this, &PipelineHandlerRkISP1::statReady); param_->bufferReady.connect(this, &PipelineHandlerRkISP1::paramReady); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index 7433ad03..377772ca 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -12,13 +12,15 @@ #include #include #include +#include #include +#include "libcamera/internal/v4l2_videodevice.h" + namespace libcamera { class MediaDevice; class V4L2Subdevice; -class V4L2VideoDevice; struct StreamConfiguration; struct V4L2SubdeviceFormat; @@ -37,6 +39,15 @@ public: int configure(const StreamConfiguration &config, const V4L2SubdeviceFormat &inputFormat); + int exportBuffers(unsigned int bufferCount, + std::vector> *buffers) + { + return video_->exportBuffers(bufferCount, buffers); + } + + int queueBuffer(FrameBuffer *buffer) { return video_->queueBuffer(buffer); } + Signal &bufferReady() { return video_->bufferReady; } + /* \todo Make video private. */ V4L2VideoDevice *video_; -- cgit v1.2.1