From patchwork Fri Aug 14 13:37:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 9328 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 95790BD87C for ; Fri, 14 Aug 2020 13:37:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1BEE76138F; Fri, 14 Aug 2020 15:37:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="pbGF/PeN"; dkim-atps=neutral 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 6C8776038B for ; Fri, 14 Aug 2020 15:37:20 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D7BFF2B3; Fri, 14 Aug 2020 15:37:18 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1597412240; bh=lOyciPU+hAB6KOF3wKHL1cLnwmiPPWiIDddaB6baVbw=; h=From:To:Cc:Subject:Date:From; b=pbGF/PeNyzL6tiPNDms9F/VdpGkK6+FzXIYW6Yh23gkmYWnOgXvNz1C76n4GIju12 LKmAC+VR4jZruB+L+ZFcm0eNed5foXDHxQ6stcSmL7bKEXTs92YTVdLyDRZ6DFHHmL 1SQgycREsMvaoOM7eXZ2QAFzzboNEgx7Ihj65Gvk= From: Kieran Bingham To: libcamera devel Date: Fri, 14 Aug 2020 14:37:14 +0100 Message-Id: <20200814133714.46846-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: request: Facilitate retrieval of the camera 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" Provide a means of identifying the Camera object which created the Request. This allows identifying the correct Camera device to work with in completion callbacks which are not otherwise wrapped with a means to identify the Camera responsible for completion. Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- include/libcamera/request.h | 2 ++ src/libcamera/request.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index eded68318b7d..ae8d450da20b 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -36,6 +36,8 @@ public: Request &operator=(const Request &) = delete; ~Request(); + Camera *camera() const { return camera_; } + ControlList &controls() { return *controls_; } ControlList &metadata() { return *metadata_; } const std::map &buffers() const { return bufferMap_; } diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index f3753514131a..3ef0e061a270 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -80,6 +80,13 @@ Request::~Request() delete validator_; } +/** + * \fn Request::camera() + * \brief Retrieve the camera that created the request + * + * \return A pointer to the camera associated with the request + */ + /** * \fn Request::controls() * \brief Retrieve the request's ControlList