From patchwork Fri Feb 4 13:38:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 15329 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 C618CBDCBF for ; Fri, 4 Feb 2022 13:38:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C69C60A16; Fri, 4 Feb 2022 14:38:45 +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="ROfjTymZ"; 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 439FA6020C for ; Fri, 4 Feb 2022 14:38: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 B7A62739; Fri, 4 Feb 2022 14:38:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1643981923; bh=NxlA/6HAYGF+MsudiAbwgi3kd7ifXt6xedNcbBmsc98=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ROfjTymZz7zU7fxAjE9bHSAy/xC0qMXcqB8pkAW1FzARcyApa5Nx+9QUbY7BJkwpj sAKe3GYRmst129V7qjR481ZJrzdFNSaT+j3SHYIrv3rnp2+SizUsYdMC/lb8ZQzElx ZajIN31JAbB5fdbnOXjM7ha98FgCqs4Ftbz4LY6w= From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org, David Plowman , Kieran Bingham , Laurent Pinchart Date: Fri, 4 Feb 2022 15:38:11 +0200 Message-Id: <20220204133814.303217-3-tomi.valkeinen@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220204133814.303217-1-tomi.valkeinen@ideasonboard.com> References: <20220204133814.303217-1-tomi.valkeinen@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/5] HACK: 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 1eb537e9..29da397c 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -64,6 +64,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 9c8da6ca..de3c1f80 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -513,6 +513,11 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const return it->second; } +std::shared_ptr Request::camera() const +{ + return _d()->camera()->shared_from_this(); +} + /** * \fn Request::metadata() * \brief Retrieve the request's metadata