From patchwork Sun Jul 4 23:36:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 12807 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com 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 E6D1EC3222 for ; Sun, 4 Jul 2021 23:37:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 38AAF68501; Mon, 5 Jul 2021 01:37:07 +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="RhsqPtms"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B4E4168500 for ; Mon, 5 Jul 2021 01:37:05 +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 55D952E4 for ; Mon, 5 Jul 2021 01:37:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1625441825; bh=VCeb9YNd7oBXk5xTquBkWhgDIAkPazTo5fck7MrG0vI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=RhsqPtmspumNXkw/GIMUzx9xrvG4PijAzBrZaDJEcpCfM+T/7jTs4jytGw+CiLEcP j6f093X7Lgf78hYTKgMvOqyn1FKF7p9SurrNTv2z+roeLRgVaz0hMoyHNJwKqTAzZB 4admSsjSjxGEd3MGskzeLl1z60R++PTaXbSlPwQo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 5 Jul 2021 02:36:20 +0300 Message-Id: <20210704233620.9145-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210704233620.9145-1-laurent.pinchart@ideasonboard.com> References: <20210704233620.9145-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] android: Disable copy and move for CameraDevice 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" Instances of the CameraDevice class should never be copied or moved, as they represent resources, Disable copying and moving for the class. Signed-off-by: Laurent Pinchart Reviewed-by: Paul Elder Reviewed-by: Umang Jain --- src/android/camera_device.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/android/camera_device.h b/src/android/camera_device.h index 3361918d4484..d085a27f296b 100644 --- a/src/android/camera_device.h +++ b/src/android/camera_device.h @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -66,6 +67,8 @@ protected: std::string logPrefix() const override; private: + LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraDevice) + CameraDevice(unsigned int id, std::shared_ptr camera); struct Camera3RequestDescriptor {