From patchwork Wed May 3 12:20:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18596 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 B0DB3C327C for ; Wed, 3 May 2023 12:21:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 63FB3633C1; Wed, 3 May 2023 14:21:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1683116463; bh=EYQNuwD2CifocQLUwQCnqBa/mEuzQ8CwImJ7LOF8rE8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TAo3JKoc+7GgvaTsB2FkNkroSDzpJsGoUJ/sUHzOd3MehBFPjk5Qt9JKCnezXA/pb G2W3y+Hsn2ecULicGWOeeH2F88Vsn1D+DRRH76BsqbWPZpcC4fNPWsOS97AczmzieL 6pVWiepVs51z8sWIoChlk5P+dhG9qcv0q7E9kmClEYBngBjsmRt7uAchN3kACGh5yL EOkjIwrFa5gUb0ioLRG01fSg1dBLBSDOeXq0Ub0Tt3Rby4FcdhSwe8Fy4+dmaEXFmQ lgFKhWvcz5v4LkQSaRVrcHR+vaYKnOko0l9Ausg4f2Iq0k+/J6QRSfB6mlDMLn+X2w oQoD9Tki1eyyw== Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 089DE633B6 for ; Wed, 3 May 2023 14:21:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="TW9d5Q3/"; dkim-atps=neutral Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f4000ec74aso2704705e9.3 for ; Wed, 03 May 2023 05:21:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1683116461; x=1685708461; 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=85k+ztMhbF/aIzPrrW8kN62vFz/B1zNIYtS6xm//rbQ=; b=TW9d5Q3/MfK0h9AQvUe1SHgZFTL5tRfQnAffEjMoSs+2WqMLrfkrbSE78DPb0SlvNJ 3yqh52cOwEqm869o0dbfv89FvEOglCKYamjnK3CTGhD1DcRomtNhKUbmLDmV6wExC5Vl f8DRfXq/dITBBChkAb4hdJLOIqb1N4Qo6kBKz1bHM0H6DZcUcMruk5REKO9VyXj3sjKr xOWLRdIYJUW4vjtb//DJX9UoHsnO/xRFNH4F3YEqXDNi/7MGRYXr6yOHDboQ3S8SeIOj Bb5DgPWVV0irqChtSpmxm/mFf7os4VENkTuD9zn4f8+PF8uE/Smjt1vIf37AStir3JKI xiKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683116461; x=1685708461; 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=85k+ztMhbF/aIzPrrW8kN62vFz/B1zNIYtS6xm//rbQ=; b=FWn5523TXe3WjMNXjU8sYguh64NL1nYdT/CtzmlN7saBKb8vfFefbzZavUf88dSIdL byZUZGZDU5MLz+O9XeqQFMUxXE9tK6NPXps+lZxKCihg24CiWUtlSaFE4GPrkV9SmYUX viI8D3lUYL8vy2SSnLoPMsBIEGK2HwyzFCGdJQCvq+6ZnYxT95l3MvNLjMIWDXj97c82 1+nY5pt2oC6oXDnufWvbUGKvatpk/421yd27di+8fdRA2oJ9SHHOslD/AdgAv/IQaPLf ogofqqRaIGJeBlp9v1yaTx3HJUBt9foB0MsLwo6Qwew8J6Rc4EZEUarO+X3KRnDISUyh sBbA== X-Gm-Message-State: AC+VfDxGn9YlBQdIYSkHvh59ZcmIZQEwnXGZQCl3u2W5anFkVxj7i3cQ PL9FHnpi7hfz1YgcJVdoIk5JPhHJqUwhFT7Jl8TFuA== X-Google-Smtp-Source: ACHHUZ7HDBBf75eHDttXB8yZFr7tRqeC2g06uK7g9CKGho6lz5qRz+k2+JvIO/jD5S2C7oVVZn5r/g== X-Received: by 2002:a05:600c:228f:b0:3f2:5999:4f3d with SMTP id 15-20020a05600c228f00b003f259994f3dmr14269581wmf.29.1683116461407; Wed, 03 May 2023 05:21:01 -0700 (PDT) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id f23-20020a7bcd17000000b003ee443bf0c7sm1736785wmj.16.2023.05.03.05.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 05:21:01 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 3 May 2023 13:20:33 +0100 Message-Id: <20230503122035.32026-12-naush@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230503122035.32026-1-naush@raspberrypi.com> References: <20230503122035.32026-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/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 Cc: Jacopo Mondi 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();