[{"id":15567,"web_url":"https://patchwork.libcamera.org/comment/15567/","msgid":"<YEdp+hyeWAxf/Tn5@pendragon.ideasonboard.com>","date":"2021-03-09T12:28:42","subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Marian,\n\nThank you for the patch.\n\nOn Tue, Mar 09, 2021 at 12:29:48PM +0100, Marian Cichy wrote:\n> Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>\n> ---\n>  include/libcamera/internal/media_object.h | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h\n> index 1c82c279..1ed95863 100644\n> --- a/include/libcamera/internal/media_object.h\n> +++ b/include/libcamera/internal/media_object.h\n> @@ -102,6 +102,8 @@ public:\n>  \n>  \tint setDeviceNode(const std::string &deviceNode);\n>  \n> +\tbool operator==(const MediaEntity &other) { return name() == other.name(); }\n> +\n\nDocumentation is missing, didn't doxygen warn you ?\n\nThis being said, this patch doesn't seem to be needed for 2/2, which\ncompiles fine without 1/2. Am I missing something ?\n\n>  private:\n>  \tLIBCAMERA_DISABLE_COPY_AND_MOVE(MediaEntity)\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 5D2ECBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Mar 2021 12:29:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFC5C68A9C;\n\tTue,  9 Mar 2021 13:29:14 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99FF068A99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Mar 2021 13:29:13 +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 13B25E9;\n\tTue,  9 Mar 2021 13:29:13 +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=\"KzyEBNGx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615292953;\n\tbh=LZFNAZgNvhnGiE9ytMIrkB69HpVEXDq6gQUo6sk9egs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KzyEBNGxjswwWljsX1lbtnQaUP3ziRSSNQvNGORwc+03PRhlztKZC37wm23Gz4+5h\n\tPYjAjTjezN0SVn6Sgu16gPHW3QOIRd29SGcCfBJZXkSzaStQZ3crJIs/24hwOE0BgI\n\tFaazQ2XixKn8k37b8lzQ5/Dn8NWImvbSPz7dLzJc=","Date":"Tue, 9 Mar 2021 14:28:42 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Marian Cichy <m.cichy@pengutronix.de>","Message-ID":"<YEdp+hyeWAxf/Tn5@pendragon.ideasonboard.com>","References":"<20210309112949.26251-1-m.cichy@pengutronix.de>\n\t<20210309112949.26251-2-m.cichy@pengutronix.de>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210309112949.26251-2-m.cichy@pengutronix.de>","Subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","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, graphics@pengutronix.de","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15573,"web_url":"https://patchwork.libcamera.org/comment/15573/","msgid":"<0aee5944-1f92-269d-1551-b981f39d3af7@pengutronix.de>","date":"2021-03-09T13:51:18","subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","submitter":{"id":81,"url":"https://patchwork.libcamera.org/api/people/81/","name":"Marian Cichy","email":"mci@pengutronix.de"},"content":"On 3/9/21 1:28 PM, Laurent Pinchart wrote:\n> Hi Marian,\n>\n> Thank you for the patch.\n>\n> On Tue, Mar 09, 2021 at 12:29:48PM +0100, Marian Cichy wrote:\n>> Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>\n>> ---\n>>   include/libcamera/internal/media_object.h | 2 ++\n>>   1 file changed, 2 insertions(+)\n>>\n>> diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h\n>> index 1c82c279..1ed95863 100644\n>> --- a/include/libcamera/internal/media_object.h\n>> +++ b/include/libcamera/internal/media_object.h\n>> @@ -102,6 +102,8 @@ public:\n>>   \n>>   \tint setDeviceNode(const std::string &deviceNode);\n>>   \n>> +\tbool operator==(const MediaEntity &other) { return name() == other.name(); }\n>> +\n> Documentation is missing, didn't doxygen warn you ?\n>\n> This being said, this patch doesn't seem to be needed for 2/2, which\n> compiles fine without 1/2. Am I missing something ?\n\nYou're right. I was under the impression that I need to overload this \noperator in order to use the class as keys in std::unordered_map, but it \njust works fine without the patch. So I guess better ignore this one.\n\nRegards\nMarian\n\n>\n>>   private:\n>>   \tLIBCAMERA_DISABLE_COPY_AND_MOVE(MediaEntity)\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 0D57DBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Mar 2021 13:51:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 75DA768AA3;\n\tTue,  9 Mar 2021 14:51:20 +0100 (CET)","from metis.ext.pengutronix.de (metis.ext.pengutronix.de\n\t[IPv6:2001:67c:670:201:290:27ff:fe1d:cc33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 22B7268A99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Mar 2021 14:51:19 +0100 (CET)","from erdnuss.hi.pengutronix.de\n\t([2001:67c:670:100:2e4d:54ff:fe9d:849c])\n\tby metis.ext.pengutronix.de with esmtp (Exim 4.92)\n\t(envelope-from <mci@pengutronix.de>)\n\tid 1lJcla-000457-Ij; Tue, 09 Mar 2021 14:51:18 +0100"],"To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20210309112949.26251-1-m.cichy@pengutronix.de>\n\t<20210309112949.26251-2-m.cichy@pengutronix.de>\n\t<YEdp+hyeWAxf/Tn5@pendragon.ideasonboard.com>","From":"Marian Cichy <mci@pengutronix.de>","Message-ID":"<0aee5944-1f92-269d-1551-b981f39d3af7@pengutronix.de>","Date":"Tue, 9 Mar 2021 14:51:18 +0100","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.8.0","MIME-Version":"1.0","In-Reply-To":"<YEdp+hyeWAxf/Tn5@pendragon.ideasonboard.com>","Content-Language":"en-US","X-SA-Exim-Connect-IP":"2001:67c:670:100:2e4d:54ff:fe9d:849c","X-SA-Exim-Mail-From":"mci@pengutronix.de","X-SA-Exim-Scanned":"No (on metis.ext.pengutronix.de);\n\tSAEximRunCond expanded to false","X-PTX-Original-Recipient":"libcamera-devel@lists.libcamera.org","Subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","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, graphics@pengutronix.de","Content-Transfer-Encoding":"7bit","Content-Type":"text/plain; charset=\"us-ascii\"; Format=\"flowed\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":15574,"web_url":"https://patchwork.libcamera.org/comment/15574/","msgid":"<YEeUZczCvWwV/wZ7@pendragon.ideasonboard.com>","date":"2021-03-09T15:29:41","subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Marian,\n\nOn Tue, Mar 09, 2021 at 02:51:18PM +0100, Marian Cichy wrote:\n> On 3/9/21 1:28 PM, Laurent Pinchart wrote:\n> > On Tue, Mar 09, 2021 at 12:29:48PM +0100, Marian Cichy wrote:\n> >> Signed-off-by: Marian Cichy <m.cichy@pengutronix.de>\n> >> ---\n> >>   include/libcamera/internal/media_object.h | 2 ++\n> >>   1 file changed, 2 insertions(+)\n> >>\n> >> diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h\n> >> index 1c82c279..1ed95863 100644\n> >> --- a/include/libcamera/internal/media_object.h\n> >> +++ b/include/libcamera/internal/media_object.h\n> >> @@ -102,6 +102,8 @@ public:\n> >>   \n> >>   \tint setDeviceNode(const std::string &deviceNode);\n> >>   \n> >> +\tbool operator==(const MediaEntity &other) { return name() == other.name(); }\n> >> +\n> > Documentation is missing, didn't doxygen warn you ?\n> >\n> > This being said, this patch doesn't seem to be needed for 2/2, which\n> > compiles fine without 1/2. Am I missing something ?\n> \n> You're right. I was under the impression that I need to overload this \n> operator in order to use the class as keys in std::unordered_map, but it \n> just works fine without the patch. So I guess better ignore this one.\n\nIf you were iusing MediaEntity perhaps, but you're storing pointers in\nyour containers, so nothing else should be needed.\n\n> >>   private:\n> >>   \tLIBCAMERA_DISABLE_COPY_AND_MOVE(MediaEntity)\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 DFC63BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Mar 2021 15:30:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4696068A9C;\n\tTue,  9 Mar 2021 16:30:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1FCF368A99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Mar 2021 16:30:14 +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 83E52E9;\n\tTue,  9 Mar 2021 16:30:13 +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=\"HI20USyU\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1615303813;\n\tbh=bzgunLHFZeldWz2sFY96HPgThTSL5UZy3KHY9djjEAw=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=HI20USyU1N865JaLTyLYFuhGq20p8cSfGwx43ZNVroMp8rM2uMeA+yvgaRrNAVU41\n\tJOLiaMu3vmnRcf8qFg+YnhewWXgh/GZHSeF1OFeoH/iAEfSTguSS1b2XIBcEWBr9lj\n\tiha5rR5bX1AgY5EdKJcXK5irET0el0OhNNA2jId8=","Date":"Tue, 9 Mar 2021 17:29:41 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Marian Cichy <mci@pengutronix.de>","Message-ID":"<YEeUZczCvWwV/wZ7@pendragon.ideasonboard.com>","References":"<20210309112949.26251-1-m.cichy@pengutronix.de>\n\t<20210309112949.26251-2-m.cichy@pengutronix.de>\n\t<YEdp+hyeWAxf/Tn5@pendragon.ideasonboard.com>\n\t<0aee5944-1f92-269d-1551-b981f39d3af7@pengutronix.de>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<0aee5944-1f92-269d-1551-b981f39d3af7@pengutronix.de>","Subject":"Re: [libcamera-devel] [PATCH 1/2] media_entity: Overload ==\n\toperator to use media-entities in maps","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, graphics@pengutronix.de","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]