From patchwork Wed Aug 28 01:17:04 2019 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: 1872 Return-Path: Received: from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net [195.74.38.228]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D73460E38 for ; Wed, 28 Aug 2019 03:17:46 +0200 (CEST) X-Halon-ID: 9a8a90d7-c931-11e9-bdc3-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [95.195.154.80]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 9a8a90d7-c931-11e9-bdc3-005056917a89; Wed, 28 Aug 2019 03:17:30 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Wed, 28 Aug 2019 03:17:04 +0200 Message-Id: <20190828011710.32128-8-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.22.1 In-Reply-To: <20190828011710.32128-1-niklas.soderlund@ragnatech.se> References: <20190828011710.32128-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 07/13] libcamera: request: Add RequestData 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: Wed, 28 Aug 2019 01:17:46 -0000 Add a RequestData pointer to the Request class, this is intended to be used by pipeline handlers while handling the request and is invalid outside the pipeline handler context. Signed-off-by: Niklas Söderlund --- include/libcamera/request.h | 5 +++++ src/libcamera/request.cpp | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 9edf1cedc054014f..570924c5ef5e2425 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -21,6 +21,9 @@ class Buffer; class Camera; class Stream; +class RequestData +{ +}; class Request { @@ -46,6 +49,8 @@ public: bool hasPendingBuffers() const { return !pending_.empty(); } + RequestData *data; + private: friend class Camera; friend class PipelineHandler; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index ee2158fc7a9cf0b9..4d7bf177534267ac 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -55,7 +55,7 @@ LOG_DEFINE_CATEGORY(Request) * */ Request::Request(Camera *camera, uint64_t cookie) - : camera_(camera), controls_(camera), cookie_(cookie), + : data(nullptr), camera_(camera), controls_(camera), cookie_(cookie), status_(RequestPending), cancelled_(false) { } @@ -178,6 +178,14 @@ Buffer *Request::findBuffer(Stream *stream) const * otherwise */ +/** + * \var Request::data + * \brief Pipeline handler specific data + * + * Pipeline handlers may associate private data with with an request that + * is valid for the requests liftime inside the pipeline handler. + */ + /** * \brief Validate the request and prepare it for the completion handler *