From patchwork Tue Oct 20 01:40:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10106 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 EA466BDB1F for ; Tue, 20 Oct 2020 01:40:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 57944613B7; Tue, 20 Oct 2020 03:40:57 +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="mFPI4AfU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6176D6052F for ; Tue, 20 Oct 2020 03:40:56 +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 D4FF552 for ; Tue, 20 Oct 2020 03:40:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603158056; bh=smCbNspoOOgfleVtrlTMRcslC4GC+ZMf4FghHnqjtYs=; h=From:To:Subject:Date:From; b=mFPI4AfUvE2Hpp/ULen/MGAeQ5ZtY2vi0JJKTcIbz5UUrf/Rqz+8WK9tritZh1xcT XPUDIjM8ADgCyHMPFSW+i5KNVD2dVUniF5EkQsteaqk88W/lA+VEYkB++GX+8aZniC iYU4TB/bZtobMfGM2GqXijWZXgvTpS5xpIwQegRo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Tue, 20 Oct 2020 04:40:00 +0300 Message-Id: <20201020014005.12783-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/5] libcamera: Implement d-pointer design pattern 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" Hello, This patch series implements the d-pointer design pattern in a base class, generalizing the custom implementations from the Camera and CameraManager classes. This was mostly developed as a base for the reprocessing API (the reworked camera configuration API will make use of d-pointers), but I believe it makes sense on its own. The series is quite straightforward. Patch 1/5 is new compared to v1, and adds a formatter to checkstyle.py to ensure consistent naming of variables related to this design pattern. This stems from patch 2/5, which implements the framework, not hiding variable declarations in the LIBCAMERA_D_PTR() and LIBCAMERA_O_PTR() macros anymore, as requested during review of v1. I'm still not sure which option is best, feedback will be appreciated. Patch 3/5 fixes an issue in the CameraManager class, and patches 4/5 and 5/5 replace the manual implementations. Please see individual patches for details. Laurent Pinchart (5): utils: checkstyle.py: Add d-pointer formatter libcamera: Add a base class to implement the d-pointer design pattern libcamera: camera_manager: Make CameraManager::Private::mutex_ mutable libcamera: camera_manager: Inherit from Extensible libcamera: camera: Inherit from Extensible include/libcamera/camera.h | 9 +- include/libcamera/camera_manager.h | 7 +- include/libcamera/extensible.h | 86 ++++++++++++++++++ include/libcamera/meson.build | 1 + src/libcamera/camera.cpp | 123 +++++++++++++++----------- src/libcamera/camera_manager.cpp | 57 +++++++----- src/libcamera/extensible.cpp | 134 +++++++++++++++++++++++++++++ src/libcamera/meson.build | 1 + utils/checkstyle.py | 32 +++++++ 9 files changed, 373 insertions(+), 77 deletions(-) create mode 100644 include/libcamera/extensible.h create mode 100644 src/libcamera/extensible.cpp