From patchwork Mon May 15 12:45:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 18629 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 C32D1BDE6B for ; Mon, 15 May 2023 12:45:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ED3A962866; Mon, 15 May 2023 14:45:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1684154755; bh=cU9MCDA+vWC2o/eVzEN9Xk/vzhk2eZQX1DcjmNxCw6k=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=2YQxRaqedajXl0UiTCuq3Cm0DU42vdHGbikicHhciUWC96a7HbyADZODqwMqhE7+Y kLQzGFEzDwl9OxzjpGhTPNG+fSHOYA7igTThMwhECCw+F7IVHUBWJwFSeyXfCgwQgY +2sF1acUEJ6PbLDTZgAGr55nzJYtVJz7ggpa0EnPXpY7neHSgIQwK+7h1ZAshdRuQX oaB7870+C3p86h2RScFq6Js+lgiWmGno9N9Yreww3pcD6r0aMpwKa1y//BLJJOfEji A8nvg0yjdQ4RViu/f5xweggE++WZqHLwWWmAXk7cokIukRuOZeG9yQL2MecDt+5vWt QtFC2TJ9zGwbQ== 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 BB3E76039F for ; Mon, 15 May 2023 14:45:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="PACAOjRc"; 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 C80774DB; Mon, 15 May 2023 14:45:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1684154743; bh=cU9MCDA+vWC2o/eVzEN9Xk/vzhk2eZQX1DcjmNxCw6k=; h=From:To:Cc:Subject:Date:From; b=PACAOjRcRvS20HPrb3o2AEKGTFdrkELVmPHCUeN1CoBKugc0t7yBPMNjch9p/xX0k ORUFGZsCb8D3eUoJtIPdGTc9+OT9SFcsa+QGAyl1oQhFCqbr9l+ojjBFGhyUpnhjfg oFPicTFPspTnWc6sVjW5Qfy4NEmgbUr5X5P/f1nE= To: libcamera devel Date: Mon, 15 May 2023 13:45:45 +0100 Message-Id: <20230515124550.3601128-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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. 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 | 63 +++++++++ include/libcamera/internal/meson.build | 1 + include/libcamera/internal/request.h | 6 +- src/libcamera/camera_manager.cpp | 145 +++++++------------- src/libcamera/pipeline_handler.cpp | 16 ++- src/libcamera/property_ids.yaml | 7 + 7 files changed, 134 insertions(+), 108 deletions(-) create mode 100644 include/libcamera/internal/camera_manager.h