From patchwork Mon Oct 3 21:21:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17510 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 49629BD16B for ; Mon, 3 Oct 2022 21:21:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 294FB600E9; Mon, 3 Oct 2022 23:21:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664832093; bh=W9zHDEQ/zHaZIhwA8uw5Wi+gZaInSCR6FOgo83Vs6EI=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=EZVHYOy0qlH85rfufXq38azeQlApd95gIqK86rAu9B3DLm9TLBZqEna1clYMXFlHW pauGBhS6nk8Yn2izdYFLefVswCl6twLBDGkjTMbXG+VlgTLhX/Frf4/VcZEQIDuHaR 1ezvMBbLX4dRgIlqhwWdEQ6wpxK8wfHpWaU5BOUbHjeruBOxT0MfztOSzFta6Ngpfq KhhEmbDqUrYSpKfD+x2nF6sC25sm1VpM5PA3iQ7vwnROBQyl44ragWEfIFUMpV+CBS 52GdsGX6TJjaig21PIdcXHcd0+usSCMG8Gcig2sJ3LGdW4jH20TXrx7/e0WG+sH+AR lC3/eA47aqbeQ== 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 B638A600E9 for ; Mon, 3 Oct 2022 23:21:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="rq/T1g8q"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1DDB5440 for ; Mon, 3 Oct 2022 23:21:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664832091; bh=W9zHDEQ/zHaZIhwA8uw5Wi+gZaInSCR6FOgo83Vs6EI=; h=From:To:Subject:Date:From; b=rq/T1g8qLo+liBV6qC1wYkHTjb7LunpYZJxIIkjK/S336UN36vjB3NgsDVzw9jJBN YwFQqzYC3kZwwZ4/HwSpuqhI5wg5pyAa4BvxJLysU8eLHj94NANemF+Z+0M1ybmh7r vEdl+EpFE8hP9QQq4O5eR9/gu7EbhDaxk45z7Ie0= To: libcamera-devel@lists.libcamera.org Date: Tue, 4 Oct 2022 00:21:20 +0300 Message-Id: <20221003212128.32429-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/8] libcamera: Use class templates for auto-registration 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hello, This patch series refactors auto-registration of the CameraSensorHelper and PipelineHandler instances to use class templates instead of generating code with a macro. This follows the method used for the Algorithm registration in libipa, and matches the C++ best practices. Laurent Pinchart (8): ipa: camera_sensor_helper: Make factory createInstance() function const ipa: camera_sensor_helper: Make registerType() and createInstance() private ipa: camera_sensor_helper: Return unique_ptr from createInstance ipa: camera_sensor_helper: Implement factories through class templates libcamera: pipeline_handler: Make factory create() function const libcamera: pipeline_handler: Make registerType() private libcamera: pipeline_handler: Return unique_ptr from createInstance libcamera: pipeline_handler: Implement factories through class templates include/libcamera/internal/pipeline_handler.h | 49 ++++++----- src/ipa/ipu3/ipu3.cpp | 2 +- src/ipa/libipa/camera_sensor_helper.cpp | 88 +++++++++++-------- src/ipa/libipa/camera_sensor_helper.h | 49 ++++++----- src/ipa/rkisp1/rkisp1.cpp | 2 +- src/libcamera/camera_manager.cpp | 6 +- src/libcamera/pipeline_handler.cpp | 75 ++++++++++------ test/ipa/ipa_interface_test.cpp | 6 +- 8 files changed, 162 insertions(+), 115 deletions(-)