Show a patch.

GET /api/1.1/patches/18929/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18929,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18929/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18929/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20230808125228.29043-3-jacopo.mondi@ideasonboard.com>",
    "date": "2023-08-08T12:52:21",
    "name": "[libcamera-devel,RFC,2/9] libcamera: Define and use MediaDeviceMatch",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c0c3ae502fadd3cc521e25ddec09d2f31d936a6c",
    "submitter": {
        "id": 143,
        "url": "https://patchwork.libcamera.org/api/1.1/people/143/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo.mondi@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18929/mbox/",
    "series": [
        {
            "id": 4002,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4002/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4002",
            "date": "2023-08-08T12:52:19",
            "name": "libcamera: Generalize device match and support USB devices",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4002/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18929/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18929/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 2F0FABDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  8 Aug 2023 12:52:51 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B409D627F7;\n\tTue,  8 Aug 2023 14:52:50 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D2DFB627EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  8 Aug 2023 14:52:47 +0200 (CEST)",
            "from uno.localdomain (mob-5-90-60-22.net.vodafone.it [5.90.60.22])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 9182738DA; \n\tTue,  8 Aug 2023 14:51:39 +0200 (CEST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1691499170;\n\tbh=9UO8Ks6Nkymmev/NMNhwFvpBCxbTK5Z3Uz4dlZfNIhc=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=wsml1F0AIMcvqrgP4qQK+9LkFXCgCR9IYRIs87vHIElmCen0+RaOHXDNUkyTyuVfT\n\tYgdzAdCSx5Yq5PNeziAHOwfk7MbSorX2O2F2sFqeoAjFONGqejxVgmRHRL+U6mhVpq\n\tk0zN57Ku8p623doKRVT60cn89f5o6rr8Xt5SFFUvEil8pc7TWoy+0HlLDnAnffHrSL\n\tSQUM/STSt4Qyd/d1htI+899g0nIcpJjy2Gkw5nH+Ot70nux5p0ncItPeAE27r2A9g5\n\tR47vSWXYmq85Mwsav6Uy/bWfjz3vhg0P2Jrlh/Gb4uOpHgqcyEEeqoZ3NKcU8KQAMM\n\teZcfjecdqkMOg==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1691499100;\n\tbh=9UO8Ks6Nkymmev/NMNhwFvpBCxbTK5Z3Uz4dlZfNIhc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=DNeXDtwERuGDarBmMEuV2L0RDuVYrFfbukBOTfoYFc2TDC9cIbDi9hLVKw53FNofP\n\tSE0e5DOAUkGzZBljD92As6f7adn7H9IMJVZx7XTI3aPTmZ2YNRH2KeFQ9AoqaVGQ9I\n\tBbuhLCUVxcrQ4LkUSUoRLJsMISLWhoIZrx5ZN2r0="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"DNeXDtwE\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org, Sophie Friedrich <dev@flowerpot.me>",
        "Date": "Tue,  8 Aug 2023 14:52:21 +0200",
        "Message-Id": "<20230808125228.29043-3-jacopo.mondi@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.40.1",
        "In-Reply-To": "<20230808125228.29043-1-jacopo.mondi@ideasonboard.com>",
        "References": "<20230808125228.29043-1-jacopo.mondi@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC 2/9] libcamera: Define and use\n\tMediaDeviceMatch",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The xistingdevice search and match criteria implemented by libcamera\nonly supports 'media device' based cameras, which are supported in the\nLinux kernel by the usage of the V4L2/MC API.\n\nDefine a MediaDeviceMatch class derived from DeviceMatch and use it\nwherever DeviceMatch was used in order to later introduce new derived\nclasses to support searching and matching devices of a different type.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n Documentation/guides/pipeline-handler.rst     | 10 +++---\n .../libcamera/internal/device_enumerator.h    |  2 +-\n include/libcamera/internal/device_match.h     |  9 ++++--\n include/libcamera/internal/pipeline_handler.h |  4 +--\n src/libcamera/device_enumerator.cpp           |  2 +-\n src/libcamera/device_match.cpp                | 31 ++++++++++++++-----\n src/libcamera/pipeline/imx8-isi/imx8-isi.cpp  |  2 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp          |  4 +--\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  2 +-\n src/libcamera/pipeline/rpi/vc4/vc4.cpp        |  4 +--\n src/libcamera/pipeline/simple/simple.cpp      |  4 +--\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  2 +-\n src/libcamera/pipeline/vimc/vimc.cpp          |  2 +-\n src/libcamera/pipeline_handler.cpp            |  3 +-\n test/camera-sensor.cpp                        |  2 +-\n test/delayed_controls.cpp                     |  2 +-\n test/libtest/buffer_source.cpp                |  2 +-\n test/media_device/media_device_test.cpp       |  2 +-\n test/v4l2_subdevice/v4l2_subdevice_test.cpp   |  2 +-\n test/v4l2_videodevice/v4l2_m2mdevice.cpp      |  2 +-\n .../v4l2_videodevice_test.cpp                 |  2 +-\n 21 files changed, 59 insertions(+), 36 deletions(-)",
    "diff": "diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\nindex 10b9c75c2a7f..c3b21a885e19 100644\n--- a/Documentation/guides/pipeline-handler.rst\n+++ b/Documentation/guides/pipeline-handler.rst\n@@ -90,7 +90,7 @@ functionalities described above. Below is a brief overview of each of those:\n    registered with it, by creating instances of the ``MediaDevice`` class and\n    storing them.\n \n--  `DeviceMatch <https://libcamera.org/api-html/classlibcamera_1_1DeviceMatch.html>`_:\n+-  `MediaDeviceMatch <https://libcamera.org/api-html/classlibcamera_1_1MediaDeviceMatch.html>`_:\n    Describes a media device search pattern using entity names, or other\n    properties.\n \n@@ -316,10 +316,10 @@ Matching devices\n ~~~~~~~~~~~~~~~~\n \n Each pipeline handler registered in libcamera gets tested against the current\n-system configuration, by matching a ``DeviceMatch`` with the system\n-``DeviceEnumerator``. A successful match makes sure all the requested components\n-have been registered in the system and allows the pipeline handler to be\n-initialized.\n+system configuration, by matching an instance of a class derived from\n+``DeviceMatch`` with the system ``DeviceEnumerator``. A successful match makes\n+sure all the requested components have been registered in the system and allows\n+the pipeline handler to be initialized.\n \n The main entry point of a pipeline handler is the `match()`_ class member\n function. When the ``CameraManager`` is started (using the `start()`_ function),\ndiff --git a/include/libcamera/internal/device_enumerator.h b/include/libcamera/internal/device_enumerator.h\nindex 259a9e4621ea..2afb9fa0dea8 100644\n--- a/include/libcamera/internal/device_enumerator.h\n+++ b/include/libcamera/internal/device_enumerator.h\n@@ -29,7 +29,7 @@ public:\n \tvirtual int init() = 0;\n \tvirtual int enumerate() = 0;\n \n-\tstd::shared_ptr<MediaDevice> search(const DeviceMatch &dm);\n+\tstd::shared_ptr<MediaDevice> search(const MediaDeviceMatch &dm);\n \n \tSignal<> devicesAdded;\n \ndiff --git a/include/libcamera/internal/device_match.h b/include/libcamera/internal/device_match.h\nindex 9f190f0c8a84..6df7dece1031 100644\n--- a/include/libcamera/internal/device_match.h\n+++ b/include/libcamera/internal/device_match.h\n@@ -17,11 +17,16 @@ class MediaDevice;\n class DeviceMatch\n {\n public:\n-\tDeviceMatch(const std::string &driver);\n+\tvirtual bool match(const MediaDevice *device) const = 0;\n+};\n \n+class MediaDeviceMatch : public DeviceMatch\n+{\n+public:\n \tvoid add(const std::string &entity);\n+\tMediaDeviceMatch(const std::string &driver);\n \n-\tbool match(const MediaDevice *device) const;\n+\tbool match(const MediaDevice *device) const override;\n \n private:\n \tstd::string driver_;\ndiff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex c96944f4ecc4..02b2f33727a3 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -28,7 +28,7 @@ class Camera;\n class CameraConfiguration;\n class CameraManager;\n class DeviceEnumerator;\n-class DeviceMatch;\n+class MediaDeviceMatch;\n class FrameBuffer;\n class MediaDevice;\n class PipelineHandler;\n@@ -43,7 +43,7 @@ public:\n \n \tvirtual bool match(DeviceEnumerator *enumerator) = 0;\n \tMediaDevice *acquireMediaDevice(DeviceEnumerator *enumerator,\n-\t\t\t\t\tconst DeviceMatch &dm);\n+\t\t\t\t\tconst MediaDeviceMatch &dm);\n \n \tbool acquire();\n \tvoid release(Camera *camera);\ndiff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp\nindex 49afd7834db2..3dda08380e6e 100644\n--- a/src/libcamera/device_enumerator.cpp\n+++ b/src/libcamera/device_enumerator.cpp\n@@ -229,7 +229,7 @@ void DeviceEnumerator::removeDevice(const std::string &deviceNode)\n  *\n  * \\return pointer to the matching MediaDevice, or nullptr if no match is found\n  */\n-std::shared_ptr<MediaDevice> DeviceEnumerator::search(const DeviceMatch &dm)\n+std::shared_ptr<MediaDevice> DeviceEnumerator::search(const MediaDeviceMatch &dm)\n {\n \tfor (std::shared_ptr<MediaDevice> &media : devices_) {\n \t\tif (media->busy())\ndiff --git a/src/libcamera/device_match.cpp b/src/libcamera/device_match.cpp\nindex a51b9081d398..17937d435c88 100644\n--- a/src/libcamera/device_match.cpp\n+++ b/src/libcamera/device_match.cpp\n@@ -18,21 +18,38 @@ namespace libcamera {\n \n /**\n  * \\class DeviceMatch\n+ * \\brief Pure virtual base class for device serch pattern\n+ *\n+ * The DeviceMatch class defines the interface to implement device search\n+ * patterns to allow searching and matching different device typologies, such as\n+ * media devices for V4L2/MC cameras, USB for cameras controlled through the USB\n+ * protocol which do not implement the UVC specification and for virtual\n+ * cameras.\n+ *\n+ * Pipeline handlers are expected to instantiate the correct derived class\n+ * depending on the device type they support and populate it with their desired\n+ * matching criteria. Derived classes of DeviceMatch override the pure virtual\n+ * match() function to implement custom matching criteria based on the device\n+ * type they represent.\n+ */\n+\n+/**\n+ * \\class MediaDeviceMatch\n  * \\brief Description of a media device search pattern\n  *\n- * The DeviceMatch class describes a media device using properties from the\n+ * The MediaDeviceMatch class describes a media device using properties from the\n  * Media Controller struct media_device_info, entity names in the media graph\n  * or other properties that can be used to identify a media device.\n  *\n  * The description is meant to be filled by pipeline managers and passed to a\n  * device enumerator to find matching media devices.\n  *\n- * A DeviceMatch is created with a specific Linux device driver in mind,\n+ * A MediaDeviceMatch is created with a specific Linux device driver in mind,\n  * therefore the name of the driver is a required property. One or more Entity\n  * names can be added as match criteria.\n  *\n- * Pipeline handlers are recommended to add entities to DeviceMatch as\n- * appropriare to ensure that the media device they need can be uniquely\n+ * Pipeline handlers are recommended to add entities to MediaDeviceMatch as\n+ * appropriate to ensure that the media device they need can be uniquely\n  * identified. This is useful when the corresponding kernel driver can produce\n  * different graphs, for instance as a result of different driver versions or\n  * hardware configurations, and not all those graphs are suitable for a pipeline\n@@ -43,7 +60,7 @@ namespace libcamera {\n  * \\brief Construct a media device search pattern\n  * \\param[in] driver The Linux device driver name that created the media device\n  */\n-DeviceMatch::DeviceMatch(const std::string &driver)\n+MediaDeviceMatch::MediaDeviceMatch(const std::string &driver)\n \t: driver_(driver)\n {\n }\n@@ -52,7 +69,7 @@ DeviceMatch::DeviceMatch(const std::string &driver)\n  * \\brief Add a media entity name to the search pattern\n  * \\param[in] entity The name of the entity in the media graph\n  */\n-void DeviceMatch::add(const std::string &entity)\n+void MediaDeviceMatch::add(const std::string &entity)\n {\n \tentities_.push_back(entity);\n }\n@@ -67,7 +84,7 @@ void DeviceMatch::add(const std::string &entity)\n  *\n  * \\return True if the media device matches the search pattern, false otherwise\n  */\n-bool DeviceMatch::match(const MediaDevice *device) const\n+bool MediaDeviceMatch::match(const MediaDevice *device) const\n {\n \tif (driver_ != device->driver())\n \t\treturn false;\ndiff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\nindex 9bdfff0b155e..b7670a3cad8c 100644\n--- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n+++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp\n@@ -971,7 +971,7 @@ int PipelineHandlerISI::queueRequestDevice(Camera *camera, Request *request)\n \n bool PipelineHandlerISI::match(DeviceEnumerator *enumerator)\n {\n-\tDeviceMatch dm(\"mxc-isi\");\n+\tMediaDeviceMatch dm(\"mxc-isi\");\n \tdm.add(\"crossbar\");\n \tdm.add(\"mxc_isi.0\");\n \tdm.add(\"mxc_isi.0.capture\");\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex a81c817a1255..5eca9eb0b922 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -846,7 +846,7 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n {\n \tint ret;\n \n-\tDeviceMatch cio2_dm(\"ipu3-cio2\");\n+\tMediaDeviceMatch cio2_dm(\"ipu3-cio2\");\n \tcio2_dm.add(\"ipu3-csi2 0\");\n \tcio2_dm.add(\"ipu3-cio2 0\");\n \tcio2_dm.add(\"ipu3-csi2 1\");\n@@ -856,7 +856,7 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n \tcio2_dm.add(\"ipu3-csi2 3\");\n \tcio2_dm.add(\"ipu3-cio2 3\");\n \n-\tDeviceMatch imgu_dm(\"ipu3-imgu\");\n+\tMediaDeviceMatch imgu_dm(\"ipu3-imgu\");\n \timgu_dm.add(\"ipu3-imgu 0\");\n \timgu_dm.add(\"ipu3-imgu 0 input\");\n \timgu_dm.add(\"ipu3-imgu 0 parameters\");\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 6efa79f29f66..5855c9d3cacc 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -1155,7 +1155,7 @@ bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n {\n \tconst MediaPad *pad;\n \n-\tDeviceMatch dm(\"rkisp1\");\n+\tMediaDeviceMatch dm(\"rkisp1\");\n \tdm.add(\"rkisp1_isp\");\n \tdm.add(\"rkisp1_resizer_mainpath\");\n \tdm.add(\"rkisp1_mainpath\");\ndiff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\nindex 018cf4881d0e..78fd392256e1 100644\n--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n@@ -175,7 +175,7 @@ bool PipelineHandlerVc4::match(DeviceEnumerator *enumerator)\n \t * device nodes due to a sensor subdevice failure.\n \t */\n \tfor (unsigned int i = 0; i < numUnicamDevices; i++) {\n-\t\tDeviceMatch unicam(\"unicam\");\n+\t\tMediaDeviceMatch unicam(\"unicam\");\n \t\tMediaDevice *unicamDevice = acquireMediaDevice(enumerator, unicam);\n \n \t\tif (!unicamDevice) {\n@@ -183,7 +183,7 @@ bool PipelineHandlerVc4::match(DeviceEnumerator *enumerator)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tDeviceMatch isp(\"bcm2835-isp\");\n+\t\tMediaDeviceMatch isp(\"bcm2835-isp\");\n \t\tMediaDevice *ispDevice = acquireMediaDevice(enumerator, isp);\n \n \t\tif (!ispDevice) {\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 05ba76bce630..88159a0c4197 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -1398,7 +1398,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \tunsigned int numStreams = 1;\n \n \tfor (const SimplePipelineInfo &inf : supportedDevices) {\n-\t\tDeviceMatch dm(inf.driver);\n+\t\tMediaDeviceMatch dm(inf.driver);\n \t\tmedia_ = acquireMediaDevice(enumerator, dm);\n \t\tif (media_) {\n \t\t\tinfo = &inf;\n@@ -1410,7 +1410,7 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n \t\treturn false;\n \n \tfor (const auto &[name, streams] : info->converters) {\n-\t\tDeviceMatch converterMatch(name);\n+\t\tMediaDeviceMatch converterMatch(name);\n \t\tconverter_ = acquireMediaDevice(enumerator, converterMatch);\n \t\tif (converter_) {\n \t\t\tnumStreams = streams;\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 38f48a5d9269..2114d48a2a66 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -387,7 +387,7 @@ int PipelineHandlerUVC::queueRequestDevice(Camera *camera, Request *request)\n bool PipelineHandlerUVC::match(DeviceEnumerator *enumerator)\n {\n \tMediaDevice *media;\n-\tDeviceMatch dm(\"uvcvideo\");\n+\tMediaDeviceMatch dm(\"uvcvideo\");\n \n \tmedia = acquireMediaDevice(enumerator, dm);\n \tif (!media)\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 00e6f4c6a51f..f97209ba26b0 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -442,7 +442,7 @@ int PipelineHandlerVimc::queueRequestDevice(Camera *camera, Request *request)\n \n bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n {\n-\tDeviceMatch dm(\"vimc\");\n+\tMediaDeviceMatch dm(\"vimc\");\n \n \tdm.add(\"Raw Capture 0\");\n \tdm.add(\"Raw Capture 1\");\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 9c74c6cfda70..ca177cad985c 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -22,6 +22,7 @@\n #include \"libcamera/internal/camera.h\"\n #include \"libcamera/internal/camera_manager.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n+#include \"libcamera/internal/device_match.h\"\n #include \"libcamera/internal/framebuffer.h\"\n #include \"libcamera/internal/media_device.h\"\n #include \"libcamera/internal/request.h\"\n@@ -129,7 +130,7 @@ PipelineHandler::~PipelineHandler()\n  * \\return A pointer to the matching MediaDevice, or nullptr if no match is found\n  */\n MediaDevice *PipelineHandler::acquireMediaDevice(DeviceEnumerator *enumerator,\n-\t\t\t\t\t\t const DeviceMatch &dm)\n+\t\t\t\t\t\t const MediaDeviceMatch &dm)\n {\n \tstd::shared_ptr<MediaDevice> media = enumerator->search(dm);\n \tif (!media)\ndiff --git a/test/camera-sensor.cpp b/test/camera-sensor.cpp\nindex 2a17cc79ea76..e35126ca1831 100644\n--- a/test/camera-sensor.cpp\n+++ b/test/camera-sensor.cpp\n@@ -39,7 +39,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tDeviceMatch dm(\"vimc\");\n+\t\tMediaDeviceMatch dm(\"vimc\");\n \t\tmedia_ = enumerator_->search(dm);\n \t\tif (!media_) {\n \t\t\tcerr << \"Unable to find \\'vimc\\' media device node\" << endl;\ndiff --git a/test/delayed_controls.cpp b/test/delayed_controls.cpp\nindex a8ce9828d73d..9063ef3e7a20 100644\n--- a/test/delayed_controls.cpp\n+++ b/test/delayed_controls.cpp\n@@ -38,7 +38,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tDeviceMatch dm(\"vivid\");\n+\t\tMediaDeviceMatch dm(\"vivid\");\n \t\tdm.add(\"vivid-000-vid-cap\");\n \n \t\tmedia_ = enumerator_->search(dm);\ndiff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\nindex dde11f365e43..8cb6f6353b99 100644\n--- a/test/libtest/buffer_source.cpp\n+++ b/test/libtest/buffer_source.cpp\n@@ -43,7 +43,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n \t\treturn TestFail;\n \t}\n \n-\tDeviceMatch dm(\"vivid\");\n+\tMediaDeviceMatch dm(\"vivid\");\n \tdm.add(videoDeviceName);\n \n \tmedia_ = enumerator->search(dm);\ndiff --git a/test/media_device/media_device_test.cpp b/test/media_device/media_device_test.cpp\nindex 1397d1236697..8189e068212c 100644\n--- a/test/media_device/media_device_test.cpp\n+++ b/test/media_device/media_device_test.cpp\n@@ -25,7 +25,7 @@ int MediaDeviceTest::init()\n \t\treturn TestFail;\n \t}\n \n-\tDeviceMatch dm(\"vimc\");\n+\tMediaDeviceMatch dm(\"vimc\");\n \tmedia_ = enumerator_->search(dm);\n \tif (!media_) {\n \t\tcerr << \"No VIMC media device found: skip test\" << endl;\ndiff --git a/test/v4l2_subdevice/v4l2_subdevice_test.cpp b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\nindex d8fbfd9f6b0f..56e5cc8377c4 100644\n--- a/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n+++ b/test/v4l2_subdevice/v4l2_subdevice_test.cpp\n@@ -39,7 +39,7 @@ int V4L2SubdeviceTest::init()\n \t\treturn TestFail;\n \t}\n \n-\tDeviceMatch dm(\"vimc\");\n+\tMediaDeviceMatch dm(\"vimc\");\n \tmedia_ = enumerator_->search(dm);\n \tif (!media_) {\n \t\tcerr << \"Unable to find \\'vimc\\' media device node\" << endl;\ndiff --git a/test/v4l2_videodevice/v4l2_m2mdevice.cpp b/test/v4l2_videodevice/v4l2_m2mdevice.cpp\nindex c45f581a8653..0effbf191966 100644\n--- a/test/v4l2_videodevice/v4l2_m2mdevice.cpp\n+++ b/test/v4l2_videodevice/v4l2_m2mdevice.cpp\n@@ -65,7 +65,7 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n-\t\tDeviceMatch dm(\"vim2m\");\n+\t\tMediaDeviceMatch dm(\"vim2m\");\n \t\tdm.add(\"vim2m-source\");\n \t\tdm.add(\"vim2m-sink\");\n \ndiff --git a/test/v4l2_videodevice/v4l2_videodevice_test.cpp b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\nindex 125aafd65041..addc47d2b62a 100644\n--- a/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n+++ b/test/v4l2_videodevice/v4l2_videodevice_test.cpp\n@@ -30,7 +30,7 @@ int V4L2VideoDeviceTest::init()\n \t\treturn TestFail;\n \t}\n \n-\tDeviceMatch dm(driver_);\n+\tMediaDeviceMatch dm(driver_);\n \tdm.add(entity_);\n \n \tmedia_ = enumerator_->search(dm);\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "2/9"
    ]
}