[{"id":21690,"web_url":"https://patchwork.libcamera.org/comment/21690/","msgid":"<163904320797.2066819.17573023194851879347@Monstersaurus>","date":"2021-12-09T09:46:47","subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Tomi Valkeinen (2021-12-09 09:29:03)\n> Request has Camera as a private member. Expose this so that users can\n> more easily associate a received Request to a Camera.\n> \n\nAha, I created a very similar patch in the past, but only got one ack so\nit didn't get in:\n\nhttps://patchwork.libcamera.org/patch/9328/\n\nThat one only returned a direct pointer to the Camera, and I think given\nit's the public API, returning a shared_ptr is safer, as it keeps the\ncamera alive while the application still has a reference.\n\n\nThinking futher to really horrible corner cases, if we're shutting down\nperhaps - the Camera might be destructed while the Request is still\navailable. In that instance I think the Camera would then be invalid. It\nwould be helpful if we could somehow make sure we invalidate the\npointers in the Request when the camera is destroyed.\n\n(I think once created, the ownership of the Request goes to the\napplication, so they could be 'kept' in the application after the\ndestruction of the Camera... of course that's really corner cases as it\nwould certainly be invalid to access Requests after shutting down the\nCameraManager or such).\n\n\nAnyway, I think this is probably better than mine for the shared_ptr\nreasoning so:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  include/libcamera/request.h | 2 ++\n>  src/libcamera/request.cpp   | 5 +++++\n>  2 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n> index f434335b..6e8987b6 100644\n> --- a/include/libcamera/request.h\n> +++ b/include/libcamera/request.h\n> @@ -60,6 +60,8 @@ public:\n>  \n>         std::string toString() const;\n>  \n> +       std::shared_ptr<Camera> camera() const;\n> +\n>  private:\n>         LIBCAMERA_DISABLE_COPY(Request)\n>  \n> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\n> index 17fefab7..3651e8ca 100644\n> --- a/src/libcamera/request.cpp\n> +++ b/src/libcamera/request.cpp\n> @@ -218,6 +218,11 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const\n>         return it->second;\n>  }\n>  \n> +std::shared_ptr<Camera> Request::camera() const\n> +{\n> +       return camera_->shared_from_this();\n> +}\n> +\n>  /**\n>   * \\fn Request::metadata()\n>   * \\brief Retrieve the request's metadata\n> -- \n> 2.25.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 0D6D8BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Dec 2021 09:46:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A79560876;\n\tThu,  9 Dec 2021 10:46:52 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4F76160224\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Dec 2021 10:46:51 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D1946501;\n\tThu,  9 Dec 2021 10:46:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Tn6oSzsO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639043210;\n\tbh=LvguAXcuidaWm5a6sRpqxGbYlIQ+41rkYqG1ReY2aYQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=Tn6oSzsOIP7sCb3EuLhy0vQgn748qni/BxRrC9mgndqY2sIrupHPLupBrJ7M7pH9X\n\t5qt8cFGwAD6TB14VUuwbUOm3uHRqeiNEh+sZE2jbDAHXo47QjPQ2VpsL6PVYPC4WEq\n\t/QGHL8NlDoG5WkJ2mJzl5kOe7vsHnileeX7vVPFs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>","References":"<20211209092906.37303-1-tomi.valkeinen@ideasonboard.com>\n\t<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 09 Dec 2021 09:46:47 +0000","Message-ID":"<163904320797.2066819.17573023194851879347@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21717,"web_url":"https://patchwork.libcamera.org/comment/21717/","msgid":"<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>","date":"2021-12-09T16:50:21","subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nThank you for the patch.\n\nOn Thu, Dec 09, 2021 at 11:29:03AM +0200, Tomi Valkeinen wrote:\n> Request has Camera as a private member. Expose this so that users can\n> more easily associate a received Request to a Camera.\n> \n> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> ---\n>  include/libcamera/request.h | 2 ++\n>  src/libcamera/request.cpp   | 5 +++++\n>  2 files changed, 7 insertions(+)\n> \n> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n> index f434335b..6e8987b6 100644\n> --- a/include/libcamera/request.h\n> +++ b/include/libcamera/request.h\n> @@ -60,6 +60,8 @@ public:\n>  \n>  \tstd::string toString() const;\n>  \n> +\tstd::shared_ptr<Camera> camera() const;\n\nI'm not thrilled by this, as it would prevent us from removing the\ncamera pointer stored in the Request class, which I've been tempted to\ndo already.\n\nWhy do we need this, and do we have any alternative ?\n\n> +\n>  private:\n>  \tLIBCAMERA_DISABLE_COPY(Request)\n>  \n> diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp\n> index 17fefab7..3651e8ca 100644\n> --- a/src/libcamera/request.cpp\n> +++ b/src/libcamera/request.cpp\n> @@ -218,6 +218,11 @@ FrameBuffer *Request::findBuffer(const Stream *stream) const\n>  \treturn it->second;\n>  }\n>  \n> +std::shared_ptr<Camera> Request::camera() const\n> +{\n> +\treturn camera_->shared_from_this();\n> +}\n> +\n>  /**\n>   * \\fn Request::metadata()\n>   * \\brief Retrieve the request's metadata","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 392A0BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  9 Dec 2021 16:50:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 828A96087A;\n\tThu,  9 Dec 2021 17:50:53 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 74524607DE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  9 Dec 2021 17:50:51 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CFA64501;\n\tThu,  9 Dec 2021 17:50:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"oTuTJzsZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639068651;\n\tbh=PbidL3FlRKNKP8l3NTqB88K7Ikj43cqGtmhp0g/Kz9A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=oTuTJzsZHHB5OiXOz2cyp2xg+Ui9ydYOg0L5jusob4T8rOEZWH7kB802EFq276xCx\n\tTR2jHEpejGxoUgYJs5uWNvN/qqgBGmZFOx+uLHzC2/u76mHK1t9FPIDy5UjISfYZWk\n\tyPZA2Js7zp2kATiKY48iLBlJxL9VpO09E5CxuOgM=","Date":"Thu, 9 Dec 2021 18:50:21 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>","References":"<20211209092906.37303-1-tomi.valkeinen@ideasonboard.com>\n\t<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>","Subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21736,"web_url":"https://patchwork.libcamera.org/comment/21736/","msgid":"<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","date":"2021-12-10T11:42:17","subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 09/12/2021 18:50, Laurent Pinchart wrote:\n> Hi Tomi,\n> \n> Thank you for the patch.\n> \n> On Thu, Dec 09, 2021 at 11:29:03AM +0200, Tomi Valkeinen wrote:\n>> Request has Camera as a private member. Expose this so that users can\n>> more easily associate a received Request to a Camera.\n>>\n>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>> ---\n>>   include/libcamera/request.h | 2 ++\n>>   src/libcamera/request.cpp   | 5 +++++\n>>   2 files changed, 7 insertions(+)\n>>\n>> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n>> index f434335b..6e8987b6 100644\n>> --- a/include/libcamera/request.h\n>> +++ b/include/libcamera/request.h\n>> @@ -60,6 +60,8 @@ public:\n>>   \n>>   \tstd::string toString() const;\n>>   \n>> +\tstd::shared_ptr<Camera> camera() const;\n> \n> I'm not thrilled by this, as it would prevent us from removing the\n> camera pointer stored in the Request class, which I've been tempted to\n> do already.\n> \n> Why do we need this, and do we have any alternative ?\n\nI use it to associate the completed Request with a camera. But I guess \nthe same can be done with the cookie with a few more lines.\n\n  Tomi","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 730FDBF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Dec 2021 11:42:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF19560894;\n\tFri, 10 Dec 2021 12:42:21 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC1286087E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Dec 2021 12:42:20 +0100 (CET)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 66BEAF84;\n\tFri, 10 Dec 2021 12:42:20 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SVC+Tgxf\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639136540;\n\tbh=wSJ7aP80R7I0HaeAO/K2q2HcnExqyYzMzSOBSB/6CrQ=;\n\th=To:Cc:References:From:Subject:Date:In-Reply-To:From;\n\tb=SVC+TgxfZWHcziadVmD2or7RBUwZ94ueOdDCCX7Qt35wIUr2MWIoiobAPjZc5+Mt8\n\t35P+mvGpLAVF7Fhv8CGtxopCKfQOvIAGnblrviUiCVOtyEGGb1lIt6WLE3TyeNow0E\n\ttUUc1txWYUM6Jwf0wB890c7sNfbk480P9Nm5JcGk=","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211209092906.37303-1-tomi.valkeinen@ideasonboard.com>\n\t<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>\n\t<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>","From":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","Date":"Fri, 10 Dec 2021 13:42:17 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21738,"web_url":"https://patchwork.libcamera.org/comment/21738/","msgid":"<YbNEmTt4c8vq1TL0@pendragon.ideasonboard.com>","date":"2021-12-10T12:14:17","subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Tomi,\n\nOn Fri, Dec 10, 2021 at 01:42:17PM +0200, Tomi Valkeinen wrote:\n> On 09/12/2021 18:50, Laurent Pinchart wrote:\n> > On Thu, Dec 09, 2021 at 11:29:03AM +0200, Tomi Valkeinen wrote:\n> >> Request has Camera as a private member. Expose this so that users can\n> >> more easily associate a received Request to a Camera.\n> >>\n> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n> >> ---\n> >>   include/libcamera/request.h | 2 ++\n> >>   src/libcamera/request.cpp   | 5 +++++\n> >>   2 files changed, 7 insertions(+)\n> >>\n> >> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n> >> index f434335b..6e8987b6 100644\n> >> --- a/include/libcamera/request.h\n> >> +++ b/include/libcamera/request.h\n> >> @@ -60,6 +60,8 @@ public:\n> >>   \n> >>   \tstd::string toString() const;\n> >>   \n> >> +\tstd::shared_ptr<Camera> camera() const;\n> > \n> > I'm not thrilled by this, as it would prevent us from removing the\n> > camera pointer stored in the Request class, which I've been tempted to\n> > do already.\n> > \n> > Why do we need this, and do we have any alternative ?\n> \n> I use it to associate the completed Request with a camera. But I guess \n> the same can be done with the cookie with a few more lines.\n\nI've also commented in the review of the bindings that we could move the\ncompletion handling mechanism from the CameraManager to the Camera\nclass, maybe that would also help avoiding the need to expose this\nfunction ?","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 05DF3BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 10 Dec 2021 12:14:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5EFFB6087E;\n\tFri, 10 Dec 2021 13:14:48 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 37AD460868\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 10 Dec 2021 13:14:47 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A5306F84;\n\tFri, 10 Dec 2021 13:14:46 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"uPr65l3A\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639138486;\n\tbh=8hRh3dTj9uqul94swP00+EoyDzkvbOH+JpHG1yfro/4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=uPr65l3AQGgc9e6I9c39lO4y9BCysTJjkUgoodad+bv+zlCp4btndZcgx4wu1AO+e\n\txrRnHR6MkhhUj2lw0oVrKZU0VoxJc6Zc0wibLNTBtKkz1SKFqi1mjWtsGwbhj4JUF4\n\t9Wg4RN2W+UwDbMbIuJfOSRJA3oXBQ9PqW7k8GXYw=","Date":"Fri, 10 Dec 2021 14:14:17 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","Message-ID":"<YbNEmTt4c8vq1TL0@pendragon.ideasonboard.com>","References":"<20211209092906.37303-1-tomi.valkeinen@ideasonboard.com>\n\t<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>\n\t<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>\n\t<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","Subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21800,"web_url":"https://patchwork.libcamera.org/comment/21800/","msgid":"<627b6254-b302-2e8c-addd-0044eb8d3089@ideasonboard.com>","date":"2021-12-15T13:01:15","subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","submitter":{"id":109,"url":"https://patchwork.libcamera.org/api/people/109/","name":"Tomi Valkeinen","email":"tomi.valkeinen@ideasonboard.com"},"content":"On 10/12/2021 13:42, Tomi Valkeinen wrote:\n> On 09/12/2021 18:50, Laurent Pinchart wrote:\n>> Hi Tomi,\n>>\n>> Thank you for the patch.\n>>\n>> On Thu, Dec 09, 2021 at 11:29:03AM +0200, Tomi Valkeinen wrote:\n>>> Request has Camera as a private member. Expose this so that users can\n>>> more easily associate a received Request to a Camera.\n>>>\n>>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>\n>>> ---\n>>>   include/libcamera/request.h | 2 ++\n>>>   src/libcamera/request.cpp   | 5 +++++\n>>>   2 files changed, 7 insertions(+)\n>>>\n>>> diff --git a/include/libcamera/request.h b/include/libcamera/request.h\n>>> index f434335b..6e8987b6 100644\n>>> --- a/include/libcamera/request.h\n>>> +++ b/include/libcamera/request.h\n>>> @@ -60,6 +60,8 @@ public:\n>>>       std::string toString() const;\n>>> +    std::shared_ptr<Camera> camera() const;\n>>\n>> I'm not thrilled by this, as it would prevent us from removing the\n>> camera pointer stored in the Request class, which I've been tempted to\n>> do already.\n>>\n>> Why do we need this, and do we have any alternative ?\n> \n> I use it to associate the completed Request with a camera. But I guess \n> the same can be done with the cookie with a few more lines.\n\nOh, there's another use. I have Request.set_control(), which takes a \ncontrol name (string) and a value. I need the camera instance to find \nthe control IDs.\n\nThat's currently the only way to set controls. I need to figure out some \nother way to handle it.\n\n  Tomi","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 52368BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 15 Dec 2021 13:01:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 760B160894;\n\tWed, 15 Dec 2021 14:01:20 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 24B6160113\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 15 Dec 2021 14:01:19 +0100 (CET)","from [192.168.1.111] (91-156-85-209.elisa-laajakaista.fi\n\t[91.156.85.209])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8BDC0292;\n\tWed, 15 Dec 2021 14:01:18 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"kHoVcPsE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639573278;\n\tbh=1iSJYkF6l+eTPn28Khm91bOqgvV/dgZ0k+U6kwPCIaY=;\n\th=Subject:From:To:Cc:References:Date:In-Reply-To:From;\n\tb=kHoVcPsEr3TXCmyP5GNJuOp6jrvF+vOpVOeGW94yKiu5GLo27G5vjw4fXpxO6c+gB\n\t2MHTLp7wNzwwm3vuFZUCYYdL+GfWn+49+bu/Eq2FAQKAAMcwbCXokb2YD/9SaIqxQw\n\t4z9IQYHIZOLuwWVtq9J5mafF/X2WNvzaWBZtiVTk=","From":"Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211209092906.37303-1-tomi.valkeinen@ideasonboard.com>\n\t<20211209092906.37303-3-tomi.valkeinen@ideasonboard.com>\n\t<YbIzzVxASOlf4LPW@pendragon.ideasonboard.com>\n\t<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","Message-ID":"<627b6254-b302-2e8c-addd-0044eb8d3089@ideasonboard.com>","Date":"Wed, 15 Dec 2021 15:01:15 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<e392e48e-f86a-fac4-2c07-001792111dc5@ideasonboard.com>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Language":"en-US","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [RFC v3 2/5] libcamera: Request: expose\n\tCamera from Request","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]