From patchwork Thu Aug 13 00:52:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9295 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id B03E4BD87D for ; Thu, 13 Aug 2020 00:53:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 88EC3613AC; Thu, 13 Aug 2020 02:53:44 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C4C761388 for ; Thu, 13 Aug 2020 02:53:40 +0200 (CEST) X-Halon-ID: 6c9e09fb-dcff-11ea-92dc-005056917a89 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 6c9e09fb-dcff-11ea-92dc-005056917a89; Thu, 13 Aug 2020 02:53:38 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 13 Aug 2020 02:52:38 +0200 Message-Id: <20200813005246.3265807-6-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> References: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 05/13] libcamera: pipeline: rkisp1: Create RkISP1Frames from camera data X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Create RkISP1Frames from camera data instead of picking information out form it. This is done to prepare for multi stream support where more information from the camera data will be needed. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index a1cda12d244f2d97..9d5a52d352aefabc 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -52,6 +52,7 @@ static const std::array RKISP1_RSZ_MP_FORMATS{ class PipelineHandlerRkISP1; class RkISP1ActionQueueBuffers; +class RkISP1CameraData; enum RkISP1ActionType { SetSensor, @@ -77,7 +78,7 @@ class RkISP1Frames public: RkISP1Frames(PipelineHandler *pipe); - RkISP1FrameInfo *create(unsigned int frame, Request *request, Stream *stream); + RkISP1FrameInfo *create(const RkISP1CameraData *data, Request *request); int destroy(unsigned int frame); void clear(); @@ -242,8 +243,10 @@ RkISP1Frames::RkISP1Frames(PipelineHandler *pipe) { } -RkISP1FrameInfo *RkISP1Frames::create(unsigned int frame, Request *request, Stream *stream) +RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *request) { + unsigned int frame = data->frame_; + if (pipe_->availableParamBuffers_.empty()) { LOG(RkISP1, Error) << "Parameters buffer underrun"; return nullptr; @@ -256,7 +259,7 @@ RkISP1FrameInfo *RkISP1Frames::create(unsigned int frame, Request *request, Stre } FrameBuffer *statBuffer = pipe_->availableStatBuffers_.front(); - FrameBuffer *videoBuffer = request->findBuffer(stream); + FrameBuffer *videoBuffer = request->findBuffer(&data->stream_); if (!videoBuffer) { LOG(RkISP1, Error) << "Attempt to queue request with invalid stream"; @@ -880,10 +883,8 @@ void PipelineHandlerRkISP1::stop(Camera *camera) int PipelineHandlerRkISP1::queueRequestDevice(Camera *camera, Request *request) { RkISP1CameraData *data = cameraData(camera); - Stream *stream = &data->stream_; - RkISP1FrameInfo *info = data->frameInfo_.create(data->frame_, request, - stream); + RkISP1FrameInfo *info = data->frameInfo_.create(data, request); if (!info) return -ENOENT;