From patchwork Thu Apr 27 07:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18563 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 A9D2CC0DA4 for ; Thu, 27 Apr 2023 07:20:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 16659627E0; Thu, 27 Apr 2023 09:20:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682580017; bh=XPA5YkWxr/m2NEdk1SCc61CCVEge8/8yNmAwfWtuCTc=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=l54GpmLN6Hs7KUxUEWUc8KcNy8D0DnIrqohQFZ3LwO0zbC8H0CFZE9VwJWBg4/Tiy H+pYKxtllOCs4n930Evrv1/DSLp7d6hS00rtKto6Er5g7Biy1+OmPTSsFeIXm6X0Zl OOEgLv1mPFmY6CLu3B5h3c84oE+UvJXXeVl/O17l9NXwrnW97xAgAKjEgS/iE6X64V 0F8Xv4CsH6VdJcFNgZTsy8s/Ze8jjPeAAuhqv6tT3E8ksnnTim4niKx7z6wP71i05t V8IWg1783sUWZFwvdtBMwDFD+2nXkza8W27/lzJwT22M4iLP3+ujnaOEVtj8OGlC/a 6nLibKEU+CK6Q== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FE71627D1 for ; Thu, 27 Apr 2023 09:20:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="tt3A9b6z"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-3f182d745deso80587475e9.0 for ; Thu, 27 Apr 2023 00:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1682580014; x=1685172014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rXzawEmLspCQfcLDrf2nTVlqapgr+r0VV3pxsl4fspU=; b=tt3A9b6zWg98ZEGmtMrFXMd7+1jntzUvmSYUaWMdu93BJsAc0S603AqYXQBQUhLIOL m7QowWYuC0CfMPtbttUMwqSMnLZyi+Kq0rqCe/DU2Y4wyWQhVXDBXM8C268sC3guVWDt ZgZWqAguYoVonh7jXLTlNuONCjaUVyBqiI1NHe4UhZvjiS62Gc2NSw/LqpnljRq7QoPj kZVD7YkWPXEE40wWPUsUh6vx01Of09jcK9UJDCYmkfgt4gLdbIhpN6Bs8sc9Zd9SKpmz IRgAbCtaNtN58Q9RbnWRFMO0WfCPH1icWWLztyb7iK4ooBMv7LbBueHW8+xlRflBcpEt ao1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682580014; x=1685172014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rXzawEmLspCQfcLDrf2nTVlqapgr+r0VV3pxsl4fspU=; b=MrOJKECcRkukLIm7aSfuwaLo4R1O8CS24RR5nCvU6b5PWY5jW5Srd1BBheI4zWV12X QyrjpnuI1WDyr0ESXsy+h7FA5nTNFLV1lRXqRnVaDyzX8bq7gJimgQTkNJsAx8vAm0He G1hEfbZEjiYgm7o0TvYCzo6qZVBLJuM0OgfIIFsSyJ/1xGa4Bp20Ubt/smfEbldiZbnr ZhIbTxF0S+MRfIqblrQbSoIQN2ICv7NctELj4DeQN5e81OsEbAqqoZGq8dtVts13qlBA tG030UcD2OQZTxOpjeyZ/wVK5jUe/2Mb7f0k8xnlenodJXD1/5elIaVHiqaTN+9n2e8o v3Dg== X-Gm-Message-State: AC+VfDxv+UiLWbcVuxBeyVtLgeeSEH4Z+90HtmP00UyVmHF+i+JNxrPc veVLIHWdUyh1Tfs/+XQ75DgkafFAPrdkSf48MDdJmg== X-Google-Smtp-Source: ACHHUZ6pgWddSyLfxERMkZEbcGKj/K039Tt328FpxkuYplPVBakW23VfE+cs/hnplvoYiRboc+iaDQ== X-Received: by 2002:a05:600c:ad9:b0:3f1:7bac:d411 with SMTP id c25-20020a05600c0ad900b003f17bacd411mr642811wmr.39.1682580014050; Thu, 27 Apr 2023 00:20:14 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id u7-20020a5d5147000000b002cde25fba30sm17822015wrt.1.2023.04.27.00.20.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 00:20:13 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 27 Apr 2023 08:20:14 +0100 Message-Id: <20230427072014.26890-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426131057.21550-11-naush@raspberrypi.com> References: <20230426131057.21550-11-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] pipeline: raspberrypi: Make RPi::Stream::name() return const std::string & 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Return a const std::string reference from RPi::Stream::name() to avoid copying a string when not needed. Signed-off-by: Naushir Patuck Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/rpi/common/rpi_stream.cpp | 2 +- src/libcamera/pipeline/rpi/common/rpi_stream.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp index 3690667e9aa6..b7e4130f5e56 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp @@ -19,7 +19,7 @@ V4L2VideoDevice *Stream::dev() const return dev_.get(); } -std::string Stream::name() const +const std::string &Stream::name() const { return name_; } diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h index 1aae674967e1..b8c74de35863 100644 --- a/src/libcamera/pipeline/rpi/common/rpi_stream.h +++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h @@ -49,7 +49,7 @@ public: } V4L2VideoDevice *dev() const; - std::string name() const; + const std::string &name() const; bool isImporter() const; void resetBuffers();