From patchwork Sun Jun 30 23:38:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1549 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D2B5961F46 for ; Mon, 1 Jul 2019 01:38:44 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 819DF255 for ; Mon, 1 Jul 2019 01:38:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1561937924; bh=CsQMXeHj7pDQVn7vHWJ5yIaOzWLdc/egGpQtVEelLkw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XAZ2uZzbSuNpa/gGsB0Y07Sbk87YH8mb488emx2Ty64l8kvcfOxv5mXIGrubbA74p 8giUmLoY+gZ2lgrrRm5SY/yWw0V42dDNZfpuIJyZv/dvfhyvE//NOptpGEkYtBbghc M3zYUzQfrJkwaQu5HzrvoBorOSdRy5vskqWNruQU= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 1 Jul 2019 02:38:10 +0300 Message-Id: <20190630233817.10130-8-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190630233817.10130-1-laurent.pinchart@ideasonboard.com> References: <20190630233817.10130-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 07/14] libcamera: request: Add a ControlList X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Jun 2019 23:38:46 -0000 From: Kieran Bingham Provide a ControlList on request objects to facilitate setting controls. Signed-off-by: Kieran Bingham --- include/libcamera/request.h | 3 +++ src/libcamera/request.cpp | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 58de6f00a554..8075270a9a12 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -11,6 +11,7 @@ #include #include +#include namespace libcamera { @@ -32,6 +33,7 @@ public: Request(const Request &) = delete; Request &operator=(const Request &) = delete; + ControlList &controls() { return controls_; } const std::map &buffers() const { return bufferMap_; } int setBuffers(const std::map &streamMap); Buffer *findBuffer(Stream *stream) const; @@ -50,6 +52,7 @@ private: bool completeBuffer(Buffer *buffer); Camera *camera_; + ControlList controls_; std::map bufferMap_; std::unordered_set pending_; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index fa3ee46da440..7d91e7f900fe 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -48,10 +48,20 @@ LOG_DEFINE_CATEGORY(Request) * \param[in] camera The camera that creates the request */ Request::Request(Camera *camera) - : camera_(camera), status_(RequestPending) + : camera_(camera), controls_(camera), status_(RequestPending) { } +/** + * \fn Request::controls() + * \brief Retrieve the request's ControlList + * + * Return a reference to the ControlList that stores all the controls relevant + * to this request. + * + * \return A reference to the ControlList in this request + */ + /** * \fn Request::buffers() * \brief Retrieve the request's streams to buffers map @@ -158,6 +168,9 @@ void Request::complete(Status status) { ASSERT(!hasPendingBuffers()); status_ = status; + + /* Controls are 'per-frame' and not re-usable */ + controls_.clear(); } /**