{"id":24142,"url":"https://patchwork.libcamera.org/api/patches/24142/?format=json","web_url":"https://patchwork.libcamera.org/patch/24142/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20250815135253.2231076-1-barnabas.pocze@ideasonboard.com>","date":"2025-08-15T13:52:52","name":"[RFC,v1,1/2] libcamera: device_enumerator: Take list of entity names in ctor","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"300d7e81e98fab0f0d94bdfc49177a456322d067","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/24142/mbox/","series":[{"id":5385,"url":"https://patchwork.libcamera.org/api/series/5385/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5385","date":"2025-08-15T13:52:52","name":"[RFC,v1,1/2] libcamera: device_enumerator: Take list of entity names in ctor","version":1,"mbox":"https://patchwork.libcamera.org/series/5385/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/24142/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/24142/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 986E4BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 15 Aug 2025 13:52:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A75DA6925A;\n\tFri, 15 Aug 2025 15:52:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F37BE61443\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Aug 2025 15:52:56 +0200 (CEST)","from pb-laptop.local (185.221.141.188.nat.pool.zt.hu\n\t[185.221.141.188])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B793D8FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 15 Aug 2025 15:52:01 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PUJutLc+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1755265921;\n\tbh=ot9tDkn/8pPOFYE55eEBjkG1AtKr4xO2BvANrZ+VZdE=;\n\th=From:To:Subject:Date:From;\n\tb=PUJutLc+2re+AIc8ZTMfT29L8moUOpNL7o1Ld1uS3hu0dZRoISzVqYNGuR+qinWTb\n\te/0sYRA2B0hwBY2jmzzpQiQZXxRP/au/x5+Z1VSm0cn22vG2EZfWuNZHPKVHuSU4m8\n\tBf2LbakMFphob0k4Cj0vmV+FTeAoTmtFQK4pXWYo=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[RFC PATCH v1 1/2] libcamera: device_enumerator: Take list of entity\n\tnames in ctor","Date":"Fri, 15 Aug 2025 15:52:52 +0200","Message-ID":"<20250815135253.2231076-1-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.50.1","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Make it possible to pass a list of entity names to the `DeviceMatch`\nconstructor, thereby simplifying the construction if there is a known\nset of entity names by avoiding the repeated `add()` calls.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n include/libcamera/internal/device_enumerator.h | 5 ++++-\n src/libcamera/device_enumerator.cpp            | 7 +++++--\n 2 files changed, 9 insertions(+), 3 deletions(-)","diff":"diff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h\nindex db3532a98..cb055e166 100644\n--- a/include/libcamera/internal/device_enumerator.h\n+++ b/include/libcamera/internal/device_enumerator.h\n@@ -7,8 +7,10 @@\n \n #pragma once\n \n+#include <initializer_list>\n #include <memory>\n #include <string>\n+#include <string_view>\n #include <vector>\n \n #include <libcamera/base/signal.h>\n@@ -20,7 +22,8 @@ class MediaDevice;\n class DeviceMatch\n {\n public:\n-\tDeviceMatch(const std::string &driver);\n+\tDeviceMatch(const std::string &driver,\n+\t\t    std::initializer_list<std::string_view> entities = {});\n \n \tvoid add(const std::string &entity);\n \ndiff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\nindex ae17862f6..ec98418fa 100644\n--- a/src/libcamera/device_enumerator.cpp\n+++ b/src/libcamera/device_enumerator.cpp\n@@ -66,9 +66,12 @@ LOG_DEFINE_CATEGORY(DeviceEnumerator)\n /**\n  * \\brief Construct a media device search pattern\n  * \\param[in] driver The Linux device driver name that created the media device\n+ * \\param[in] entities The list of media graph entity names to search\n  */\n-DeviceMatch::DeviceMatch(const std::string &driver)\n-\t: driver_(driver)\n+DeviceMatch::DeviceMatch(const std::string &driver,\n+\t\t\t std::initializer_list<std::string_view> entities)\n+\t: driver_(driver),\n+\t  entities_(entities.begin(), entities.end())\n {\n }\n \n","prefixes":["RFC","v1","1/2"]}