From patchwork Mon Jul 1 20:14:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 1565 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 4A25C6157D for ; Mon, 1 Jul 2019 22:15:30 +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 EC8CB1200 for ; Mon, 1 Jul 2019 22:15:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1562012130; bh=97rotAarLcRh7B0x2D9xvvSQFwEyzgihulrD5ySrM20=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aB8W0TxzhXkxEVWcLBEohbsO7Bif4bC1fY4UNaER59VtMykwz93wuOMNvc7V/GIXw lI0tkMbspGFP+YOCSNrq+Ns0NZlxiQ8IgZP9bxfx7HXt56YkROGXIBkSs0b/D2h28l V08L3+LsgUf0SRky8sqQNcCIChxEcSbFGZflRNII= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 1 Jul 2019 23:14:57 +0300 Message-Id: <20190701201504.28487-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190701201504.28487-1-laurent.pinchart@ideasonboard.com> References: <20190701201504.28487-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 06/13] 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: Mon, 01 Jul 2019 20:15:31 -0000 From: Kieran Bingham Provide a ControlList on request objects to facilitate setting controls. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- Changes since v3: - Don't clear controls when the request completes - Fixed include ordering --- include/libcamera/request.h | 3 +++ src/libcamera/request.cpp | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 58de6f00a554..a93468d7c8b7 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -10,6 +10,7 @@ #include #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..e749e41baa42 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