From patchwork Thu Jun 15 17:26:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18737 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 475FDC322E for ; Thu, 15 Jun 2023 17:26:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A5DD561E4F; Thu, 15 Jun 2023 19:26:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1686849976; bh=W0ouoJLicYFejQ+DRMO7q/J5Vjuo5vLYg2eULizdl0U=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ecOXOAdXednq5nrMAHtx62tWbHVBl4Wl1kglP51fBM5whk1Jgy/347BKJgwjTB9Ug ZgVujT1MTVSk/QZTpzxkReqmztbDD2y9zx6Wa6p+QSu4Sn5OzEFEFI4IVLTvWWYzVL GPTXdcL3syvD3OR0aZUOGH3c9H9qUm6t0MCxbSfT1yrHzrbsAtrkAbjF2MZbD37dOy ToC40+LTHm4BKTlKXZ3czy9ClLJ2bHIbXEzSQeo5ZHsi6gCx1JLn64iwANNcuu+Nyu R5/pyTZdISzz8eUfhO87z9YEgwxrk5C4O7tsxTFsclJgWN2SL6boVcPxGw9kbNlOF3 rBhciLu3zOeGQ== 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 A3F1A614FE for ; Thu, 15 Jun 2023 19:26:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PB2KUF32"; dkim-atps=neutral Received: from Monstersaurus.local (aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net [82.37.23.78]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E740F547; Thu, 15 Jun 2023 19:25:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1686849944; bh=W0ouoJLicYFejQ+DRMO7q/J5Vjuo5vLYg2eULizdl0U=; h=From:To:Cc:Subject:Date:From; b=PB2KUF32/uypWu3UgWn5l4VeYNN0ngpgsA92yGWKJF0sY6wNYGvVyz1RkMvtTeGDU 4jCpQHJSFlwBvYRJ1qNDVekncuWyKNB52Mf5E+g2CPu6aBTympY6z3aSIih2c8qaBf DgpeNYPp5I0+yZbjt1AAAExRkXvGDd58krTHCYWU= To: libcamera devel Date: Thu, 15 Jun 2023 18:26:03 +0100 Message-Id: <20230615172608.378258-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 0/5] libcamera: Add new Camera devices property 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: Kieran Bingham via libcamera-devel From: Kieran Bingham Reply-To: Kieran Bingham Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" It can be beneficial to allow reporting the devices used by a camera to facilitate de-duplication of resources when handling cameras from a centralised infrastructure such as PipeWire. Expose a new property on all cameras which reports a list of dev_t values representing devices used by the camera. Pipelines supported by media-controller will automatically register an entry for any video node present in the media graphs registered with the Pipeline Handler.. As part of supporting this, we move the addCamera and removeCamera public API calls from the CameraManager class away into an internal implementation of the CameraManager with the use of the Extensible class. This series also now converts include/libcamera/internal/request.h to use #pragma once which was missed during the original conversions and noticed as I referenced it when creating include/libcamera/internal/camera_manager.h. v4: - Fix includes - Fix sort order of header in meson.build - Fix doxygen file references - Report that different cameras may report identical devices - Rename to SystemDevices Kieran Bingham (5): libcamera: internal: request: convert to pragma once libcamera: camera_manager: Move private implementation to internal libcamera: camera_manager: Move {add,remove}Camera to internal libcamera: properties: Provide a Devices camera property libcamera: pipeline: Register device numbers with camera include/libcamera/camera_manager.h | 4 - include/libcamera/internal/camera_manager.h | 69 +++++++++ include/libcamera/internal/meson.build | 1 + include/libcamera/internal/request.h | 6 +- src/libcamera/camera_manager.cpp | 154 +++++++------------- src/libcamera/pipeline_handler.cpp | 16 +- src/libcamera/property_ids.yaml | 9 ++ 7 files changed, 147 insertions(+), 112 deletions(-) create mode 100644 include/libcamera/internal/camera_manager.h