From patchwork Fri Nov 27 13:37:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 10517 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 3589BBE176 for ; Fri, 27 Nov 2020 13:38:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9BA3063475; Fri, 27 Nov 2020 14:38:00 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LgTyJnsY"; dkim-atps=neutral Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 71E8D6346F for ; Fri, 27 Nov 2020 14:37:59 +0100 (CET) Received: by mail-lj1-x230.google.com with SMTP id j10so5961378lja.5 for ; Fri, 27 Nov 2020 05:37:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UcPMN0dB2DN/VUM9wTqxxSQynbXUVyrYsOQZZ4wBYm8=; b=LgTyJnsYoiNZI4Of4A5GsXEGZApjRq0JQBpKdBLTxW+FyVWMzms26JOGNEXLVy7Xkb a1hzFHFXo22WtePykhl2Ge1UEDfLDBzVSL/+qshev6OXrQnyxFh7ajrxRkL9JtuioGjX XWMygs5XpbQf8H/dwlJhmJs1hEl+/CANSoh6bJTovy9BK6KW9VK5jKzwoafYeU/PqQe/ zHhxXUQsD1bYQ5rSCpaotwaYEs44R+8/vZ6LTM/vd0tBPe9adWXT9zv56jmuyQE7Zvoa eyh4ZmpF/A+fxHoudOpjXdjtjdrlulrCGDKI47JkLNJcL1Q0snq4nLL5CDZeJx4GuKuF jSAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=UcPMN0dB2DN/VUM9wTqxxSQynbXUVyrYsOQZZ4wBYm8=; b=O9tBmHH2OQQJlZmCsha1IXmpm0sYBX3keZF6L4sZu6FF/3sF1Dxv+h7odb9fFXD3sc zT8zPXZ3jYoX50aFNCj9BfVlRj339lJl/1R6uZmbDedCUIH/jGeRYnH4x9acOO55/Ua+ 7BAtkioa/tNv4k8RZonKV+whPUPn6FwueVH0pokAHhOkDsMoed/n0UkntKpYqyLd7Xm1 YSaTUUaBHc266IuoKjG20EDvEwQKbXWu/bKCEYUa7FC1UtLpH4PcmOZ2890yQTue15LY kYldjt+vY/q7tnhx7hWgvTlSZDpEXLowaQpkyAa0ovMY9Nt4enz/ZZqf9pK+ADVEU57o 2Tnw== X-Gm-Message-State: AOAM530/W9H7PTvtk26ZmSdpjOArQk0fOgNbrfqK2kdMnpM1Hl2S4SQD gEHNgOFiv2SDlxcRumfmSmXAYMGbU5w= X-Google-Smtp-Source: ABdhPJyjCTd+koGTJwgIzbtVg1ugg9vWKDh9RGRaznU260JsJU1D6uEfBy/TrH+Fk6FcUfF5WE9FoQ== X-Received: by 2002:a2e:8110:: with SMTP id d16mr3327701ljg.280.1606484278753; Fri, 27 Nov 2020 05:37:58 -0800 (PST) Received: from deskari.ti.com (91-152-83-50.elisa-laajakaista.fi. [91.152.83.50]) by smtp.gmail.com with ESMTPSA id z199sm690892lfc.42.2020.11.27.05.37.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 05:37:58 -0800 (PST) From: Tomi Valkeinen To: libcamera-devel@lists.libcamera.org Date: Fri, 27 Nov 2020 15:37:36 +0200 Message-Id: <20201127133738.880859-3-tomi.valkeinen@iki.fi> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201127133738.880859-1-tomi.valkeinen@iki.fi> References: <20201127133738.880859-1-tomi.valkeinen@iki.fi> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC v2 2/4] HACK: 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: , Cc: Tomi Valkeinen , Tomi Valkeinen Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Py bindings need to find out which camera is the source of the completed Request. Request already has a private field for the Camera, so we can just expose it via a getter. Signed-off-by: Tomi Valkeinen Reviewed-by: Kieran Bingham --- include/libcamera/request.h | 1 + src/libcamera/request.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 655b1324..f98ef767 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -56,6 +56,7 @@ public: bool hasPendingBuffers() const { return !pending_.empty(); } + std::shared_ptr camera() const; private: friend class PipelineHandler; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index a68684ef..5a50ec6b 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -216,6 +216,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