Show a patch.

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

{
    "id": 94,
    "url": "https://patchwork.libcamera.org/api/patches/94/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/94/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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": "<20181228075743.28637-5-jacopo@jmondi.org>",
    "date": "2018-12-28T07:57:43",
    "name": "[libcamera-devel,RESEND,v2,4/4] libcamera: media device: Add 'match()' method",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "486b2caad3cb96a4f13d7e335fe368959032a224",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/94/mbox/",
    "series": [
        {
            "id": 40,
            "url": "https://patchwork.libcamera.org/api/series/40/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=40",
            "date": "2018-12-28T07:57:39",
            "name": "Add MediaDevice and associated MediaObject",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/40/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/94/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/94/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C121360B32\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 Dec 2018 08:58:00 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5CB9B1BF206;\n\tFri, 28 Dec 2018 07:58:00 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 28 Dec 2018 08:57:43 +0100",
        "Message-Id": "<20181228075743.28637-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20181228075743.28637-1-jacopo@jmondi.org>",
        "References": "<20181228075743.28637-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH RESEND v2 4/4] libcamera: media device:\n\tAdd 'match()' method",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Fri, 28 Dec 2018 07:58:00 -0000"
    },
    "content": "Add 'match()' method to the MediaDevice class. The method allows\nmatching the media device against a MediaDeviceDesc.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/media_device.h |  2 ++\n src/libcamera/media_device.cpp       | 19 +++++++++++++++++++\n 2 files changed, 21 insertions(+)\n\n--\n2.20.1",
    "diff": "diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h\nindex e1b26e2..9f6d091 100644\n--- a/src/libcamera/include/media_device.h\n+++ b/src/libcamera/include/media_device.h\n@@ -75,6 +75,8 @@ public:\n \tint enumerate(std::map<std::string, std::string> &entitiesMap);\n \tvoid dumpGraph(std::ostream &os);\n\n+\tbool match(MediaDeviceDesc &desc);\n+\n \tint resetLinks();\n \tint link(const std::string &source, unsigned int sourceIdx,\n \t\t const std::string &sink, unsigned int sinkIdx,\ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex b98d62f..a961506 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -453,6 +453,25 @@ int MediaDevice::setupLink(const MediaPad *source, const MediaPad *sink,\n \treturn 0;\n }\n\n+/**\n+ * \\brief Match the media device represented by this object against\n+ *\t  a media device description \\a desc\n+ * \\param desc The media device description to math this MediaDevice against\n+ */\n+bool MediaDevice::match(MediaDeviceDesc &desc)\n+{\n+\t/* TODO: add more fields to MediaDeviceDesc and match them\n+\t * against media_device_info fields if required */\n+\tif (name_ != desc.driver())\n+\t\treturn false;\n+\n+\tfor (std::string &e : desc.entities())\n+\t\tif (!getEntityByName(e))\n+\t\t\treturn false;\n+\n+\treturn true;\n+}\n+\n /**\n  * \\fn MediaDevice::resetLinks()\n  * \\brief Reset all links on the media graph\n",
    "prefixes": [
        "libcamera-devel",
        "RESEND",
        "v2",
        "4/4"
    ]
}