From patchwork Sat Aug 22 13:46:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9361 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 A3055BE174 for ; Sat, 22 Aug 2020 13:46:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C4DF862758; Sat, 22 Aug 2020 15:46:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="RuTeVQaf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2FEE76212A for ; Sat, 22 Aug 2020 15:46:28 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id BFE6E4FB for ; Sat, 22 Aug 2020 15:46:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1598103987; bh=YoBvnr6VFlU1YA0d/v0pZ8gRr1ZEXwd5b91OeX700cY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RuTeVQafkDTVfPMtkMCgd07NH7I40gVQUgirC+s3QCgPXemQSVDQKk8sb04ek9TCV 4g4yZglZM4VusmKN4Sv/m13su+xLtovjUhxBCAFP8o3Cxr7xYL4rDkow/K9pyRlbac l9NzEhPJRPPZoDjkWwZ/0eefmcugj2Tjk2NMt664= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 22 Aug 2020 16:46:03 +0300 Message-Id: <20200822134605.17666-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200822134605.17666-1-laurent.pinchart@ideasonboard.com> References: <20200822134605.17666-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] v4l2: camera_proxy: Pass const reference to setFmtFromConfig() 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The setFmtFromConfig() method doesn't modify its parameter, make it const. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Paul Elder --- src/v4l2/v4l2_camera_proxy.cpp | 4 ++-- src/v4l2/v4l2_camera_proxy.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 63affaeec1b3..079257f4bf22 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -162,10 +162,10 @@ bool V4L2CameraProxy::validateMemoryType(uint32_t memory) return memory == V4L2_MEMORY_MMAP; } -void V4L2CameraProxy::setFmtFromConfig(StreamConfiguration &streamConfig) +void V4L2CameraProxy::setFmtFromConfig(const StreamConfiguration &streamConfig) { const PixelFormatInfo &info = PixelFormatInfo::info(streamConfig.pixelFormat); - Size size = streamConfig.size; + const Size &size = streamConfig.size; curV4L2Format_.fmt.pix.width = size.width; curV4L2Format_.fmt.pix.height = size.height; diff --git a/src/v4l2/v4l2_camera_proxy.h b/src/v4l2/v4l2_camera_proxy.h index f06b5b87083c..79eb87bcea51 100644 --- a/src/v4l2/v4l2_camera_proxy.h +++ b/src/v4l2/v4l2_camera_proxy.h @@ -39,7 +39,7 @@ public: private: bool validateBufferType(uint32_t type); bool validateMemoryType(uint32_t memory); - void setFmtFromConfig(StreamConfiguration &streamConfig); + void setFmtFromConfig(const StreamConfiguration &streamConfig); void querycap(std::shared_ptr camera); int tryFormat(struct v4l2_format *arg); enum v4l2_priority maxPriority();