From patchwork Wed Apr 26 13:10:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18558 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 63A6DBDCBD for ; Wed, 26 Apr 2023 13:13:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 12529627E6; Wed, 26 Apr 2023 15:13:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1682514821; bh=/mODpDy9ae6RAbY4u8qElAFie9GlwGqlL9wtGupX6Us=; 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=IM9Olix67s21n1eZqelrOLRRuQsbCBHqQ4oVC5JsoU76D0QPVdijOhKYXBaLLcCPE hau+ZCtR6CiLYxIOmvLxkbff3sSdQ+u3qxI/zpmXnuKGwbnX32TrwcUZjtBsvw1Hwk y1XUX/a/8HjVBnXJU8shffF5MZYkGUpgN0iwjhqVEzxek82x6ZiwFqDM3oVsHvr9RG YLu2vfQfVfqZw6VccscSQ8TIcv2zqK9A3TPRQ8usigO3GbILad4SbmjoY4SqK+uQ0o b6d0TMGTu3ildj1PV8yPVRiJfPKE10XIex7Q/hqCyyhn9wBHlWhmhaMN9Igloyh8gw 9f80mZEwPa4bw== Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 727B4627DF for ; Wed, 26 Apr 2023 15:13:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="qyZkMlZc"; dkim-atps=neutral Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3f18dacd392so43721615e9.0 for ; Wed, 26 Apr 2023 06:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1682514819; x=1685106819; 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=IZJohyqvcH9rNGAHJTnrio/fvnwZIvDrGoCaJPfxj3g=; b=qyZkMlZcl/xYEQvAub/rBoLtlvrSkaMmM9xCs3kMC9HUU+gFHT76nufxAo4ioq25JB iKa2xquzLGUTRqmxwh+rqTLsFXqvrlKQ3cjJgDIqwY52wM4BfUBiNfEAXiRFifYxztw4 CntK9cK8+E6N7VpvtoTOxDtg0shUHaLGh8Ur/+0iUOgf1tr0RVm2RZazBmDh9N7mQlWI p07NrCiLfzzXzWWQ5RhpnZvFxd/i34oPdEa9UFegM/GiCzGv8zD7IBTfWXmrVBEdfWot LlTf/aF/XHDGBqTLoun2pdQIiLnKUUyVd8iulSw2zoA2RC2qyH49D4DLw7ZRZ5qtsNEv RC/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682514819; x=1685106819; 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=IZJohyqvcH9rNGAHJTnrio/fvnwZIvDrGoCaJPfxj3g=; b=NAq1awCrveQRFo1T6D6+9HZre/k/FLuL0j/yk3wa3qZeTgYn7DYozX/8SDoo2EpTZb 4osY21zgqtHdrU/adlNa4Ap8RKZOrA001qqQK8F+6tw9YE01MoplR81PpKZ8y0OnTtei tnQsayKHDAHeU2ycmqKYaxSpYNCyI7F0jU4P+bMvwG7sKvcDiTZom2/fp6hsFC9VKi0G ODFsy5oE401BTF8Fd1N1Crfmh0aPNYiYMiRWzFq50dUxfQUrn8yzyO7Gq+GMfFbefB4R sr/+LcEXAeDpfCui9X43St1VSvn8RL4neCoCkYS2/wkJ3CN1q4k9GcQ5I7wtNzRYO3xP LMcQ== X-Gm-Message-State: AAQBX9dJSLzc0Pa4GNes0QDK8Ga6MziOVMef+9OxW1fi2Ib9bIOXB41K +3S+pDl3KyZ7wgdbiSX6XXHUrHh2Ccqmv9TpPf6Xug== X-Google-Smtp-Source: AKy350aWwzMDRShhF4qDn5LI6nqJQvKIXS7AdvGQ2d31qFYGyS7kCLS8ktoKgRjbAT7igap/BdFB8g== X-Received: by 2002:a05:600c:219a:b0:3f1:8c37:fa79 with SMTP id e26-20020a05600c219a00b003f18c37fa79mr12753615wme.31.1682514818844; Wed, 26 Apr 2023 06:13:38 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b002f103ca90cdsm15780949wrp.101.2023.04.26.06.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 06:13:38 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 26 Apr 2023 14:10:54 +0100 Message-Id: <20230426131057.21550-11-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230426131057.21550-1-naush@raspberrypi.com> References: <20230426131057.21550-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/13] 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. --- 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();