[{"id":26949,"web_url":"https://patchwork.libcamera.org/comment/26949/","msgid":"<7g6irly7gqxaaalnbulxh7jm65i5wunw5522bizp656t3rg7zg@a772o6igimrd>","date":"2023-04-27T07:46:29","subject":"Re: [libcamera-devel] [PATCH] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Thu, Apr 27, 2023 at 08:20:14AM +0100, Naushir Patuck via libcamera-devel wrote:\n> Return a const std::string reference from RPi::Stream::name() to avoid\n> copying a string when not needed.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 2 +-\n>  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index 3690667e9aa6..b7e4130f5e56 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -19,7 +19,7 @@ V4L2VideoDevice *Stream::dev() const\n>  \treturn dev_.get();\n>  }\n>\n> -std::string Stream::name() const\n> +const std::string &Stream::name() const\n>  {\n>  \treturn name_;\n>  }\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index 1aae674967e1..b8c74de35863 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -49,7 +49,7 @@ public:\n>  \t}\n>\n>  \tV4L2VideoDevice *dev() const;\n> -\tstd::string name() const;\n> +\tconst std::string &name() const;\n>  \tbool isImporter() const;\n>  \tvoid resetBuffers();\n>\n> --\n> 2.34.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 04276C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Apr 2023 07:46:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B1BC9627DF;\n\tThu, 27 Apr 2023 09:46:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2F517627DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Apr 2023 09:46:33 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:5d2e:52c9:1cf0:b3bc:c785:4625])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 42D13C7E;\n\tThu, 27 Apr 2023 09:46:21 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682581594;\n\tbh=ugHgJ7cA56i66miAgW7oqFT+0oOKRMCAaehhOFUngdc=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=fLyIFtT6em19YrDFj4aAM9/jFm7VqKBYR3ovAm7NN217aLKy9ecpMUDVHm1/jJsm+\n\tW6UjB9ILEgo/8jQ3lmS0Zug+uV/zecNMzXilhZ4qM3i6r5aTgwc4QLvfjARqWN0DMg\n\ttNceuKHiDQuE/9k9AI38kigf0f4iwmmK3uRb7MbfP33gsJDUKl2NbJZZf0NUvcdw35\n\tTvndn+NRi5o8KQ6yBaymKJU7DZkOun4OdGIo20SeoKGXfP0lzjpArcVKdAaVALk/GX\n\teu8vbtDNTCwVDz/jT8JbbbWRG4G+JE3zYmCOm4RNL25nI4w9Qskwiq8WC7fgU87GUW\n\tX4tZynyGq7xdw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1682581581;\n\tbh=ugHgJ7cA56i66miAgW7oqFT+0oOKRMCAaehhOFUngdc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fU0SDBdCl6OWCgOORLMNjdzyUdHUZ1KPNwm2hSKcQvMfLBYURduCfkhi8zXt20QAa\n\tp+C9bjFsY6h8xUo1eb94+X02APR6l39nAsea/cV/KfyRo26wJxUk4RQYiZe+PR9Faw\n\ttzqwzNpzVxh9Tm7+NjxblgJX/DhkRbx73PQJIMB4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"fU0SDBdC\"; dkim-atps=neutral","Date":"Thu, 27 Apr 2023 09:46:29 +0200","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<7g6irly7gqxaaalnbulxh7jm65i5wunw5522bizp656t3rg7zg@a772o6igimrd>","References":"<20230426131057.21550-11-naush@raspberrypi.com>\n\t<20230427072014.26890-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230427072014.26890-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26969,"web_url":"https://patchwork.libcamera.org/comment/26969/","msgid":"<20230427140332.GD28489@pendragon.ideasonboard.com>","date":"2023-04-27T14:03:32","subject":"Re: [libcamera-devel] [PATCH] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Thu, Apr 27, 2023 at 08:20:14AM +0100, Naushir Patuck via libcamera-devel wrote:\n> Return a const std::string reference from RPi::Stream::name() to avoid\n> copying a string when not needed.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 2 +-\n>  src/libcamera/pipeline/rpi/common/rpi_stream.h   | 2 +-\n>  2 files changed, 2 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> index 3690667e9aa6..b7e4130f5e56 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n> @@ -19,7 +19,7 @@ V4L2VideoDevice *Stream::dev() const\n>  \treturn dev_.get();\n>  }\n>  \n> -std::string Stream::name() const\n> +const std::string &Stream::name() const\n>  {\n>  \treturn name_;\n>  }\n> diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> index 1aae674967e1..b8c74de35863 100644\n> --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n> @@ -49,7 +49,7 @@ public:\n>  \t}\n>  \n>  \tV4L2VideoDevice *dev() const;\n> -\tstd::string name() const;\n> +\tconst std::string &name() const;\n>  \tbool isImporter() const;\n>  \tvoid resetBuffers();\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 15804BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Apr 2023 14:03:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C0950627E0;\n\tThu, 27 Apr 2023 16:03:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D90C627B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Apr 2023 16:03:21 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B118802;\n\tThu, 27 Apr 2023 16:03:08 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682604202;\n\tbh=vlPSSc/9oAFFNDQAL3Q2hGH2kBBOYCAcOCPAnts4p/w=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=Paywfhy+kPT3WrETrF82DHh8Ct+o23qqLaH165/v30UopViszXOKYdeU62uHff1zO\n\thDvo+hj1CG3Svm8bNsdf0CbhDew3O4qY1bT5aZyZUvsVYDFKLLgS0BVWc0Xx/KqufZ\n\tQzuyCZjxbELzL+1+/HDI+V1V7Fq8UlHBFQcy2g3cM8UN16MQ7cbou2YVVtSD3QyQcP\n\tGKeepbevKR2v+D1un4O7QrgOZPy+HP9pE66yqnDftKz3tcf0EQUaTtXCkDQlh2ELgh\n\tSlw+bp0wWE6H9uu7tlcgdgL1OXu0DgzgpAzakcwSQEhIeM7uklTlYG482loHmEef0u\n\tpcoXUiPvssNxQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1682604189;\n\tbh=vlPSSc/9oAFFNDQAL3Q2hGH2kBBOYCAcOCPAnts4p/w=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AeYftZIonXq/B0MVnI025+wsGGcsWoRy4ax4qwWz+H89QmFa8osqIfvll0j9pRDss\n\tqWfGY2QPJtD08FsWa2L6dHbWw1rg3ylPoJdnTshzGQKEBJI0q4erbLhGV+F8/yNQS3\n\tqkwFXJP+haAa5sQn+yv8SNKU6GgHcWQdPMDd2D+0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"AeYftZIo\"; dkim-atps=neutral","Date":"Thu, 27 Apr 2023 17:03:32 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<20230427140332.GD28489@pendragon.ideasonboard.com>","References":"<20230426131057.21550-11-naush@raspberrypi.com>\n\t<20230427072014.26890-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230427072014.26890-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH] pipeline: raspberrypi: Make\n\tRPi::Stream::name() return const std::string &","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]