[{"id":27096,"web_url":"https://patchwork.libcamera.org/comment/27096/","msgid":"<20230515092904.s4sg57dwjqeqg4hp@lati>","date":"2023-05-15T09:29:04","subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Sophie,\n  sorry for the very long delay in reviewing this patch\n\nlet me cc Harvey which, as you might know, is working on adding a\npipeline handler implementation that does not use the media device\nabstraction.\n\nHarvey: Sophie is instead introducing a generalized form of device\nmatching that can be made to use different identifiers than the media\nentities names. I wonder if this is something that could help with\nvirtual pipeline (see below)\n\nOn Thu, Mar 02, 2023 at 01:54:14AM +0100, Sophie Friedrich via libcamera-devel wrote:\n> In preparation for introducing libusb support into libcamera, we need\n> to generalize the matching functionality. The `MediaEntity` class was\n> never meant to handle the cases required for e.g. libusb. Additionally\n> the current way matching is handled is insufficient for (future)\n> `MediaDevices` in which a specific key/value relationship exists\n> for properties (e.g. USB vid and pid).\n\nDo I get it right that you plan to use the vid as key and the pid as\nvalue ?\n\n>\n> To solve these two problems I've abstracted away the requirements for\n> entities that `DeviceMatch` requires in `DeviceMatchEntityInterface`\n> and extended `DeviceMatch` to handle key/value pairs. Using \"*\" as a\n> key is currently a catch all for the presumably keyless property of\n> V4L2 `MediaEntity`.\n\nHarvey: my understanding is that your plan is to define the number of\nvirtual cameras in a configuration file. I wonder if by introducing a\ndevice enumerator that parses the configuration file we could create\nsome form of matching for the Virtual pipeline handler.\n\nThe \"ConfigurationFileDeviceEnumerator\" would define a number of\n\"virtual instances\" and the virtual pipeline handler will be matches\nagainst each of them. This would allow to create multiple instances of\nthe virtual pipeline handler to test it, and in future, if this would\never be useful, to match different version of the virtual pipeline\nhandler against different 'tags' specified in the configuration. Do\nyou think it's something that might prove useful ?\n\n>\n> Sophie Friedrich (1):\n>   libcamera: enumeration: Generalize DeviceMatch\n>\n>  .../libcamera/internal/device_enumerator.h    |  16 +--\n>  include/libcamera/internal/device_match.h     |  46 +++++++\n>  include/libcamera/internal/media_device.h     |   1 +\n>  include/libcamera/internal/media_object.h     |   7 +-\n>  include/libcamera/internal/meson.build        |   1 +\n>  src/libcamera/device_enumerator.cpp           |  73 ----------\n>  src/libcamera/device_match.cpp                | 126 ++++++++++++++++++\n>  src/libcamera/meson.build                     |   1 +\n>  8 files changed, 183 insertions(+), 88 deletions(-)\n>  create mode 100644 include/libcamera/internal/device_match.h\n>  create mode 100644 src/libcamera/device_match.cpp\n>\n> --\n> 2.34.1\n>","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 E5F4CC3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 15 May 2023 09:29:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 36D5C6039F;\n\tMon, 15 May 2023 11:29:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40EAC6039A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 15 May 2023 11:29:08 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 705204DB;\n\tMon, 15 May 2023 11:28:57 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684142950;\n\tbh=1wBk8o7IOcBTvtklPdqSYfVFQaaMfm4xLVR0NGNyfh4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ljJdKQQ1+q4240Gyzrix7voCCFcYOfD8uaeGE3J9oDaq/dmY73wOwF4bYvUeXnKDp\n\tBnbasD1Sznz2M3vTaP20pb47GC9IVigcRwjqY1L8o5WP9R348x92K4PtunJBY49sCo\n\tsRABgx4ex/0tALfaHcA7CPihRJ3iZGGlItyH5yr90oaG2Kc0LgNDGB3hKgHTyGlrhU\n\tosIZIIy9YvFCXDhWPGFH8OMLRASi1q+OItzZsIHPeyvR3e7EFhsW7zHZm9WXuU5+wq\n\tGyyPIN+hIDEa5IOj2qquXSYJFftFOpGRts1qbuXn99Bp0+TCy2xGEwXfNoTNmibxqO\n\txllHVi9j/0X3w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1684142937;\n\tbh=1wBk8o7IOcBTvtklPdqSYfVFQaaMfm4xLVR0NGNyfh4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=e+I5zSmFx3eztmTeNPsD7Xzd21bFDp7FbyW7c/45hNAcAM6DhCB44z2kaF/c4k6TF\n\trHnwtZq8hIyVfUaMh3UCOUMbJVCrVbOvuippSeas+EZBb0zH6mRRMZlP0dmccVPfN/\n\t5chY6zNccx9RXuEUlFZh58JAt5yJX4f4Xez47exw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"e+I5zSmF\"; dkim-atps=neutral","Date":"Mon, 15 May 2023 11:29:04 +0200","To":"Sophie Friedrich <dev@flowerpot.me>","Message-ID":"<20230515092904.s4sg57dwjqeqg4hp@lati>","References":"<20230302005415.1789544-1-dev@flowerpot.me>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230302005415.1789544-1-dev@flowerpot.me>","Subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tHarvey Yang <chenghaoyang@chromium.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27127,"web_url":"https://patchwork.libcamera.org/comment/27127/","msgid":"<CAEB1ahsbCes3BO7T4cbYy0f4jN7rWL-CvjQqC+jLA3NHNpRUMg@mail.gmail.com>","date":"2023-05-22T12:22:52","subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","submitter":{"id":117,"url":"https://patchwork.libcamera.org/api/people/117/","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"content":"Thanks Jacopo for forwarding this to me!\n\nOn Mon, May 15, 2023 at 5:29 PM Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nwrote:\n\n> Hi Sophie,\n>   sorry for the very long delay in reviewing this patch\n>\n> let me cc Harvey which, as you might know, is working on adding a\n> pipeline handler implementation that does not use the media device\n> abstraction.\n>\n> Harvey: Sophie is instead introducing a generalized form of device\n> matching that can be made to use different identifiers than the media\n> entities names. I wonder if this is something that could help with\n> virtual pipeline (see below)\n>\n> On Thu, Mar 02, 2023 at 01:54:14AM +0100, Sophie Friedrich via\n> libcamera-devel wrote:\n> > In preparation for introducing libusb support into libcamera, we need\n> > to generalize the matching functionality. The `MediaEntity` class was\n> > never meant to handle the cases required for e.g. libusb. Additionally\n> > the current way matching is handled is insufficient for (future)\n> > `MediaDevices` in which a specific key/value relationship exists\n> > for properties (e.g. USB vid and pid).\n>\n> Do I get it right that you plan to use the vid as key and the pid as\n> value ?\n>\n>\nI don't really understand the difference of the key and the value in\n`DeviceMatchEntityInterface`: it seems that `DeviceMatch::match`\nneeds to compare them both to match an entity, so why not merging\nthem into one (say id or key)? For USB devices, we can come up with an\nencoder\nthat takes vid and pid into one single id.\n\nUnless there are further plans for the key and the value that I'm not aware\nof :)\n\n\n> >\n> > To solve these two problems I've abstracted away the requirements for\n> > entities that `DeviceMatch` requires in `DeviceMatchEntityInterface`\n> > and extended `DeviceMatch` to handle key/value pairs. Using \"*\" as a\n> > key is currently a catch all for the presumably keyless property of\n> > V4L2 `MediaEntity`.\n>\n> Harvey: my understanding is that your plan is to define the number of\n> virtual cameras in a configuration file. I wonder if by introducing a\n> device enumerator that parses the configuration file we could create\n> some form of matching for the Virtual pipeline handler.\n>\n>\nYes, that makes a lot of sense to me. I'll update\nhttps://patchwork.libcamera.org/patch/18532/ when this patch is merged.\n\n\n> The \"ConfigurationFileDeviceEnumerator\" would define a number of\n> \"virtual instances\" and the virtual pipeline handler will be matches\n> against each of them. This would allow to create multiple instances of\n> the virtual pipeline handler to test it, and in future, if this would\n> ever be useful, to match different version of the virtual pipeline\n> handler against different 'tags' specified in the configuration. Do\n> you think it's something that might prove useful ?\n>\n>\nYes, that sounds very applicable to me. I don't have a clear view of the\nbenefit of multiple VirtualPipelineHandlers though. I guess that's why\nwe need a DeviceEnumerator though :)\n\n\n> >\n> > Sophie Friedrich (1):\n> >   libcamera: enumeration: Generalize DeviceMatch\n> >\n> >  .../libcamera/internal/device_enumerator.h    |  16 +--\n> >  include/libcamera/internal/device_match.h     |  46 +++++++\n> >  include/libcamera/internal/media_device.h     |   1 +\n> >  include/libcamera/internal/media_object.h     |   7 +-\n> >  include/libcamera/internal/meson.build        |   1 +\n> >  src/libcamera/device_enumerator.cpp           |  73 ----------\n> >  src/libcamera/device_match.cpp                | 126 ++++++++++++++++++\n> >  src/libcamera/meson.build                     |   1 +\n> >  8 files changed, 183 insertions(+), 88 deletions(-)\n> >  create mode 100644 include/libcamera/internal/device_match.h\n> >  create mode 100644 src/libcamera/device_match.cpp\n> >\n> > --\n> > 2.34.1\n> >\n>","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 DA358C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 May 2023 12:23:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 262226285F;\n\tMon, 22 May 2023 14:23:06 +0200 (CEST)","from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com\n\t[IPv6:2607:f8b0:4864:20::e33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 156A560536\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 May 2023 14:23:05 +0200 (CEST)","by mail-vs1-xe33.google.com with SMTP id\n\tada2fe7eead31-437df8c864bso1437727137.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 May 2023 05:23:05 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684758186;\n\tbh=k03aKpYSyEvzsiTDL0J7gQfeoZeqAB3C7DQFFD31g7o=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=YFjPwRr+Zr7QKLEm//WkOxHR6qWFHHBHMvSlgiWT4tHd5l84PU9apkKyYe56aGcy2\n\tkjyQgk+ODZhyZha/V7mIpdRiqjeCFXCxMwa0LmTOGoB6W8QBDcSA80u0nDPzIco/ym\n\tsCjE7FCRdV4ET6m80IOQf2GDnke14a8guOLO7pJkIZQHL3LyX3i0oHd09/c64Ov+9I\n\th8WG+dQZMHloqjXbOy/VVE2L5m4ZYUyxdGxJXGID2LgAPBKUzuyNLHiRBsiH74iYzm\n\tMw14yYbygAWiNPkw+Lx/nLT4aSkhqBo5rQ9kobJTvQEUfZ7z6b0/kO7Q5pGid4q5e4\n\tmUfFooYZ5M23Q==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1684758184; x=1687350184;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=X8pRSQr9niHYyD0xQ2ge83a81FhN47Q6LxI3zg/A7iU=;\n\tb=SS+y3Vp3cJyUtATdJJML3Csa+Fec8JK0aHzD3gLSmNW3p2qL+MIs1SHitbX98kDgPN\n\tNUPgNR9+K0Pi13mOg9ecppSoHlvEhuopSYvYROo0nxGNOePGxdBc+rUGEPS7hBj6b3as\n\t/QIT8FlirrIUH+Rgt26I7xnRTMhmc9X82T7KY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=chromium.org\n\theader.i=@chromium.org header.b=\"SS+y3Vp3\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1684758184; x=1687350184;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=X8pRSQr9niHYyD0xQ2ge83a81FhN47Q6LxI3zg/A7iU=;\n\tb=YVPpodjR5eOwmrSxCsVYHf708vtFvPb3DaxhaHpcPd8y9VZ97Cc+JVkrkfY2m4JX0A\n\twdIrs4fHJQiiV6CenOwxLf4XAezym2rP9uHZi6C9cNl3LKdDWuhfOTT39LFWehmGz8oS\n\tATE3PCHSE1Tc7UkQ76Do3f2G7G9MuFrOv9Sf/JXrf8MQttS1z47PGfrs4kCNqKshJ8xt\n\toR50Gd5Hdpp2Bw4PMYvUza21PzyBNnXd9vzeLFqMp/ef/+a0A1gKkNSLFFlxOtOIWFep\n\th6hy0RF7CVhEgIALAg6zrMiyAiJH97WcQ5D5a4LmePzNAO/64qgq9egXKyEtETkldUu7\n\tc/pA==","X-Gm-Message-State":"AC+VfDwg8ZRuEK/JySAR5fVsS6Am2fyz4G3e/7RXZmMtyKeN3NKVT5kn\n\t+b33feEaslax36z4XrJCUxZ/808vnUrN+cCmubLrzg==","X-Google-Smtp-Source":"ACHHUZ4hymTPAKbBc01/31xS3NmGJvL44pk+BLZuE/3fdjFxVU7H4uO0lIx8YyRZnQr5qOMkSw/XO5+z9mdUtq/U8LI=","X-Received":"by 2002:a67:f2c9:0:b0:42f:e944:7ea0 with SMTP id\n\ta9-20020a67f2c9000000b0042fe9447ea0mr2855793vsn.6.1684758183700;\n\tMon, 22 May 2023 05:23:03 -0700 (PDT)","MIME-Version":"1.0","References":"<20230302005415.1789544-1-dev@flowerpot.me>\n\t<20230515092904.s4sg57dwjqeqg4hp@lati>","In-Reply-To":"<20230515092904.s4sg57dwjqeqg4hp@lati>","Date":"Mon, 22 May 2023 20:22:52 +0800","Message-ID":"<CAEB1ahsbCes3BO7T4cbYy0f4jN7rWL-CvjQqC+jLA3NHNpRUMg@mail.gmail.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000127f3005fc475536\"","Subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","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>","From":"Cheng-Hao Yang via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Cc":"libcamera-devel@lists.libcamera.org, Sophie Friedrich <dev@flowerpot.me>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27129,"web_url":"https://patchwork.libcamera.org/comment/27129/","msgid":"<vrlwzwnuwcbs6frcl5r4za6fg4c6v3xcixz5ylp73fhqxdkzzp@t4hjfn2m3mg2>","date":"2023-05-22T13:37:04","subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Harvey\n\nOn Mon, May 22, 2023 at 08:22:52PM +0800, Cheng-Hao Yang via libcamera-devel wrote:\n> Thanks Jacopo for forwarding this to me!\n>\n> On Mon, May 15, 2023 at 5:29 PM Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> wrote:\n>\n> > Hi Sophie,\n> >   sorry for the very long delay in reviewing this patch\n> >\n> > let me cc Harvey which, as you might know, is working on adding a\n> > pipeline handler implementation that does not use the media device\n> > abstraction.\n> >\n> > Harvey: Sophie is instead introducing a generalized form of device\n> > matching that can be made to use different identifiers than the media\n> > entities names. I wonder if this is something that could help with\n> > virtual pipeline (see below)\n> >\n> > On Thu, Mar 02, 2023 at 01:54:14AM +0100, Sophie Friedrich via\n> > libcamera-devel wrote:\n> > > In preparation for introducing libusb support into libcamera, we need\n> > > to generalize the matching functionality. The `MediaEntity` class was\n> > > never meant to handle the cases required for e.g. libusb. Additionally\n> > > the current way matching is handled is insufficient for (future)\n> > > `MediaDevices` in which a specific key/value relationship exists\n> > > for properties (e.g. USB vid and pid).\n> >\n> > Do I get it right that you plan to use the vid as key and the pid as\n> > value ?\n> >\n> >\n> I don't really understand the difference of the key and the value in\n> `DeviceMatchEntityInterface`: it seems that `DeviceMatch::match`\n> needs to compare them both to match an entity, so why not merging\n> them into one (say id or key)? For USB devices, we can come up with an\n> encoder\n> that takes vid and pid into one single id.\n>\n> Unless there are further plans for the key and the value that I'm not aware\n> of :)\n>\n\nLet's hear from Sophie how she plans to use them\n\n>\n> > >\n> > > To solve these two problems I've abstracted away the requirements for\n> > > entities that `DeviceMatch` requires in `DeviceMatchEntityInterface`\n> > > and extended `DeviceMatch` to handle key/value pairs. Using \"*\" as a\n> > > key is currently a catch all for the presumably keyless property of\n> > > V4L2 `MediaEntity`.\n> >\n> > Harvey: my understanding is that your plan is to define the number of\n> > virtual cameras in a configuration file. I wonder if by introducing a\n> > device enumerator that parses the configuration file we could create\n> > some form of matching for the Virtual pipeline handler.\n> >\n> >\n> Yes, that makes a lot of sense to me. I'll update\n> https://patchwork.libcamera.org/patch/18532/ when this patch is merged.\n>\n>\n> > The \"ConfigurationFileDeviceEnumerator\" would define a number of\n> > \"virtual instances\" and the virtual pipeline handler will be matches\n> > against each of them. This would allow to create multiple instances of\n> > the virtual pipeline handler to test it, and in future, if this would\n> > ever be useful, to match different version of the virtual pipeline\n> > handler against different 'tags' specified in the configuration. Do\n> > you think it's something that might prove useful ?\n> >\n> >\n> Yes, that sounds very applicable to me. I don't have a clear view of the\n> benefit of multiple VirtualPipelineHandlers though. I guess that's why\n> we need a DeviceEnumerator though :)\n>\n\nThe actual benefits of multiple virtual pipeline handlers are not 100%\nclear to me neither at this point. Still I would consider enumerating\ncameras from config file neat, as it integrates well with how libcamera\nworks in that regard. It could be considered an overkill though. Maybe\nan RFC would help quantify how hard it would be to land it. I can try\nhave a look\n\n\n>\n> > >\n> > > Sophie Friedrich (1):\n> > >   libcamera: enumeration: Generalize DeviceMatch\n> > >\n> > >  .../libcamera/internal/device_enumerator.h    |  16 +--\n> > >  include/libcamera/internal/device_match.h     |  46 +++++++\n> > >  include/libcamera/internal/media_device.h     |   1 +\n> > >  include/libcamera/internal/media_object.h     |   7 +-\n> > >  include/libcamera/internal/meson.build        |   1 +\n> > >  src/libcamera/device_enumerator.cpp           |  73 ----------\n> > >  src/libcamera/device_match.cpp                | 126 ++++++++++++++++++\n> > >  src/libcamera/meson.build                     |   1 +\n> > >  8 files changed, 183 insertions(+), 88 deletions(-)\n> > >  create mode 100644 include/libcamera/internal/device_match.h\n> > >  create mode 100644 src/libcamera/device_match.cpp\n> > >\n> > > --\n> > > 2.34.1\n> > >\n> >","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 977C7C3284\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 22 May 2023 13:37:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8E6F6285F;\n\tMon, 22 May 2023 15:37:08 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C329660536\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 22 May 2023 15:37:07 +0200 (CEST)","from ideasonboard.com (host-87-10-52-171.retail.telecomitalia.it\n\t[87.10.52.171])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF31D9DE;\n\tMon, 22 May 2023 15:36:51 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1684762628;\n\tbh=+7I6lWto86A+L4ZFnZixbQbEYFgNrVcLHjFLhYCA6FM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=o0NhYYKrjFlP5JSTLlOVVtciKBBIZceKMdil4E1hbwuUxxLqTy7g3xkYMHYt1SQAL\n\tUh4WVUH861+1ADfhalT6h1qBpetrLqizL2mJyh4tCrW8qYULGfCfn6H0vlCTG/5S3R\n\tqyRuw89rOllqxnQHi1u7gQZWPx9B42EQtlzGhEDClaf7L+Gw4IXXzFvnF6Oh7raAkX\n\tjEyow4pyzs34WgrMeFYXB/xbWffZcheBnzg37fYZAR0zYwSgjWDT7XqaJPexjlUTRy\n\tcpSU4Vpq+TjJPyjT3i0O/Xzm9PL94QYOdlWb/RWCs1kHDw2bxQSFL7SROGr8HBWM5S\n\tlYr7V2J8ObzuA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1684762612;\n\tbh=+7I6lWto86A+L4ZFnZixbQbEYFgNrVcLHjFLhYCA6FM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=S4bTVjuBXsQSQf2Lkme27D6LyzZ7yDTrPNi6/uVugs4Xht7eNDeNvrnv5janwpeBV\n\txw4PLr98WKXxMl4WnQDf3RhQQM2touk5HOM1jCqay1g1DdYmxTarTqgB9vEe0j8/wi\n\ti+OZO43w5X7kui86Q6HPZDjfn3j9kOdpcK92gCmU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"S4bTVjuB\"; dkim-atps=neutral","Date":"Mon, 22 May 2023 15:37:04 +0200","To":"Cheng-Hao Yang <chenghaoyang@chromium.org>","Message-ID":"<vrlwzwnuwcbs6frcl5r4za6fg4c6v3xcixz5ylp73fhqxdkzzp@t4hjfn2m3mg2>","References":"<20230302005415.1789544-1-dev@flowerpot.me>\n\t<20230515092904.s4sg57dwjqeqg4hp@lati>\n\t<CAEB1ahsbCes3BO7T4cbYy0f4jN7rWL-CvjQqC+jLA3NHNpRUMg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEB1ahsbCes3BO7T4cbYy0f4jN7rWL-CvjQqC+jLA3NHNpRUMg@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org, Sophie Friedrich <dev@flowerpot.me>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27346,"web_url":"https://patchwork.libcamera.org/comment/27346/","msgid":"<27aadbb7-5c1b-1f20-381d-1a40e32ff591@flowerpot.me>","date":"2023-06-15T00:02:31","subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","submitter":{"id":154,"url":"https://patchwork.libcamera.org/api/people/154/","name":"Sophie Friedrich","email":"dev@flowerpot.me"},"content":"Hi Harvey and Jacopo,\n\nOn 22/05/2023 15:37, Jacopo Mondi wrote:\n> Hi Harvey\n> \n> On Mon, May 22, 2023 at 08:22:52PM +0800, Cheng-Hao Yang via libcamera-devel wrote:\n>> Thanks Jacopo for forwarding this to me!\n>>\n>> On Mon, May 15, 2023 at 5:29 PM Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>> wrote:\n>>\n>>> Hi Sophie,\n>>>    sorry for the very long delay in reviewing this patch\n>>>\n>>> let me cc Harvey which, as you might know, is working on adding a\n>>> pipeline handler implementation that does not use the media device\n>>> abstraction.\n\nThank you this sounds like a good idea.\n\n>>> Harvey: Sophie is instead introducing a generalized form of device\n>>> matching that can be made to use different identifiers than the media\n>>> entities names. I wonder if this is something that could help with\n>>> virtual pipeline (see below)\n>>>\n>>> On Thu, Mar 02, 2023 at 01:54:14AM +0100, Sophie Friedrich via\n>>> libcamera-devel wrote:\n>>>> In preparation for introducing libusb support into libcamera, we need\n>>>> to generalize the matching functionality. The `MediaEntity` class was\n>>>> never meant to handle the cases required for e.g. libusb. Additionally\n>>>> the current way matching is handled is insufficient for (future)\n>>>> `MediaDevices` in which a specific key/value relationship exists\n>>>> for properties (e.g. USB vid and pid).\n>>>\n>>> Do I get it right that you plan to use the vid as key and the pid as\n>>> value ?\n>>>\n>>>\n>> I don't really understand the difference of the key and the value in\n>> `DeviceMatchEntityInterface`: it seems that `DeviceMatch::match`\n>> needs to compare them both to match an entity, so why not merging\n>> them into one (say id or key)? For USB devices, we can come up with an\n>> encoder\n>> that takes vid and pid into one single id.\n>>\n>> Unless there are further plans for the key and the value that I'm not aware\n>> of :)\n>>\n> \n> Let's hear from Sophie how she plans to use them\n\nMaybe using VID and PID as an example was a bit misleading. I wanted to\ngeneralize the interface in a way where we won't run into issues with\npotential requirements for other device matching in the future.\n\nIn the case of matching USB devices this would be more than just VID and\nPID. The Linux kernel finds the drivers for a new USB device by using\nthe `usb_device_id` struct which can contain more than just VID or PID\nand is even able to look at these separately. Just using VID together\nwith PID could proof to be to limiting.\n\nSee the Linux kernel docs:\nhttps://www.kernel.org/doc/html/v6.1/driver-api/basics.html#c.usb_device_id\n\nFor example, I imagine it to be used with the following keys\n(for e.g. USB)\n\n|        key       | value |\n|------------------|-------|\n| usb_id_product   | 1d6b  |\n| usb_id_vendor    | 0003  |\n| usb_bDeviceClass | 3     |\n\n\n>>>>\n>>>> Sophie Friedrich (1):\n>>>>    libcamera: enumeration: Generalize DeviceMatch\n>>>>\n>>>>   .../libcamera/internal/device_enumerator.h    |  16 +--\n>>>>   include/libcamera/internal/device_match.h     |  46 +++++++\n>>>>   include/libcamera/internal/media_device.h     |   1 +\n>>>>   include/libcamera/internal/media_object.h     |   7 +-\n>>>>   include/libcamera/internal/meson.build        |   1 +\n>>>>   src/libcamera/device_enumerator.cpp           |  73 ----------\n>>>>   src/libcamera/device_match.cpp                | 126 ++++++++++++++++++\n>>>>   src/libcamera/meson.build                     |   1 +\n>>>>   8 files changed, 183 insertions(+), 88 deletions(-)\n>>>>   create mode 100644 include/libcamera/internal/device_match.h\n>>>>   create mode 100644 src/libcamera/device_match.cpp\n>>>>\n>>>> --\n>>>> 2.34.1\n>>>>\n>>>","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 960C2BD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 15 Jun 2023 00:02:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DD05661E4D;\n\tThu, 15 Jun 2023 02:02:36 +0200 (CEST)","from mout-p-201.mailbox.org (mout-p-201.mailbox.org\n\t[80.241.56.171])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BC9AE61E49\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 15 Jun 2023 02:02:35 +0200 (CEST)","from smtp102.mailbox.org (smtp102.mailbox.org\n\t[IPv6:2001:67c:2050:b231:465::102])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256) (No client certificate requested)\n\tby mout-p-201.mailbox.org (Postfix) with ESMTPS id 4QhMtK0FNNz9sTq;\n\tThu, 15 Jun 2023 02:02:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1686787356;\n\tbh=Dyz06e7WPFu4Be7ClaUUx5jmOFlp5UWImm3eP9SsN+o=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=iFB/YgDad/GR5JyvH2dkk3z9hkidOdm1HylhjvogEdUPC6bLtHxFp/NCWqZ8dh5Jv\n\tQleQTmJmHnY9lR516nDA4ub8kVps7hxCAylJAxnkBakHLhpXP9/a874c8c5RvOhjK1\n\tN5Pwz3zd3NLdYc6858uo2qL5hGEfQPewQmCBymCxngW6SIo2hCJN2066cFa7pJLU2/\n\tu4cnyGiwzawG4EDYK3rAHCwYA62qZJeQPApXCPp1TCitC5AJgshgkMKEpNiviNu2fq\n\tReMfqQ8mzyXl693caynFXoK+/vVGBT1Pduj8p39M+Kya4OIYufvVf34pUbMrLQOUib\n\tqCRkgUUYE5OaA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=flowerpot.me;\n\ts=MBO0001; t=1686787353;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=Rox8cliUnTIl1wbGWiGHPVfvUn5cvRrzRIJ54xsmnp4=;\n\tb=Dk9tzvLpmdNs/vviCo9eEESBnBXWeMaiPBYnibtj0jeHmuS0gFk8ITUhc9MYCjARWFOunI\n\tgipnn28PLN0PhIFPVvijpnkKb3J0ghTqql831t96PlmTugscTvY/DU5yAP/CZb42UR/gik\n\tbB2J+9RosNTWKeZDXYT/mqoI3VBIPyWJHTkVHHVOiBvUnKaALIb9xdfva4SuyJ3U07e+61\n\tCWkmJqGSPuK6jfdI1WJvdgeFWk1npsxB+n/4yReb4yDrVTQcBZ5/CQkWp83Au3NpPEkIQc\n\tlFS9d6fW5gkfhnxQNWWM6VClGgUO14FVXsdFNYvdF01FUWCvEe9mihpDWqydpQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=flowerpot.me\n\theader.i=@flowerpot.me header.b=\"Dk9tzvLp\"; \n\tdkim-atps=neutral","Message-ID":"<27aadbb7-5c1b-1f20-381d-1a40e32ff591@flowerpot.me>","Date":"Thu, 15 Jun 2023 02:02:31 +0200","MIME-Version":"1.0","Content-Language":"en-US","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tCheng-Hao Yang <chenghaoyang@chromium.org>","References":"<20230302005415.1789544-1-dev@flowerpot.me>\n\t<20230515092904.s4sg57dwjqeqg4hp@lati>\n\t<CAEB1ahsbCes3BO7T4cbYy0f4jN7rWL-CvjQqC+jLA3NHNpRUMg@mail.gmail.com>\n\t<vrlwzwnuwcbs6frcl5r4za6fg4c6v3xcixz5ylp73fhqxdkzzp@t4hjfn2m3mg2>","In-Reply-To":"<vrlwzwnuwcbs6frcl5r4za6fg4c6v3xcixz5ylp73fhqxdkzzp@t4hjfn2m3mg2>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-Rspamd-Queue-Id":"4QhMtK0FNNz9sTq","Subject":"Re: [libcamera-devel] [PATCH 0/1] Generalized DeviceMatch","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>","From":"Sophie Friedrich via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Sophie Friedrich <dev@flowerpot.me>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]