From patchwork Thu Dec 9 09:29:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 15086 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 CD865C324B for ; Thu, 9 Dec 2021 09:29:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 62C8A60897; Thu, 9 Dec 2021 10:29:47 +0100 (CET) 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="DpHVEoIW"; 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 C24BD60224 for ; Thu, 9 Dec 2021 10:29:43 +0100 (CET) Received: from deskari.lan (91-156-85-209.elisa-laajakaista.fi [91.156.85.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4FE11D9D; Thu, 9 Dec 2021 10:29:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1639042183; bh=fgAU7sLIUMwLtIHTOVCDUJt0DPmlsTLP8WqgZhCIApc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DpHVEoIWCKM8wdXJB4/4bOahVGf+agXsPQleP3Aq7TpH/S1oMVIqfuXySRsjRq2J6 GBg7jEUCSv2HkD5MlMP5RVP2a05Ps0nK7wg+CyhTnBTFBaCYf1Pqr3FuFq4Uv9oag/ zf6iEeN+yTTVnsPO8rHVdu9agiI/20IACE67iw3s= From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Dec 2021 11:29:03 +0200 Message-Id: <20211209092906.37303-3-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211209092906.37303-1-tomi.valkeinen@ideasonboard.com> References: <20211209092906.37303-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose Camera from Request 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" Request has Camera as a private member. Expose this so that users can more easily associate a received Request to a Camera. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham --- include/libcamera/request.h | 2 ++ src/libcamera/request.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index f434335b..6e8987b6 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -60,6 +60,8 @@ public: std::string toString() const; + std::shared_ptr camera() const; + private: LIBCAMERA_DISABLE_COPY(Request) diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index 17fefab7..3651e8ca 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -218,6 +218,11 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const return it->second; } +std::shared_ptr Request::camera() const +{ + return camera_->shared_from_this(); +} + /** * \fn Request::metadata() * \brief Retrieve the request's metadata