Show a patch.

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

{
    "id": 13233,
    "url": "https://patchwork.libcamera.org/api/patches/13233/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13233/",
    "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": "<20210805222436.6263-3-laurent.pinchart@ideasonboard.com>",
    "date": "2021-08-05T22:24:28",
    "name": "[libcamera-devel,02/10] libcamera: pipeline: simple: Add sink and source pads to entity data",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "8f115056164fe45d06835cb38b229c7a9e2b6157",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13233/mbox/",
    "series": [
        {
            "id": 2314,
            "url": "https://patchwork.libcamera.org/api/series/2314/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2314",
            "date": "2021-08-05T22:24:26",
            "name": "Concurrent camera support in simple pipeline handler",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2314/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13233/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13233/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 D2ACEC3238\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Aug 2021 22:25:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6A36E68888;\n\tFri,  6 Aug 2021 00:24:59 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 688396880D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Aug 2021 00:24:56 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 10D3EE6B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Aug 2021 00:24:56 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"efA7V7Pv\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628202296;\n\tbh=Dv6AGKiQbU1IefbMdrQivJnjZwPcTQwEyUhtER1M2OE=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=efA7V7PvZD7bZF2VsCqnCagMeQMP87Bx0V2n9gLaAf3MdzydyxmzJx22QsiTX0MqE\n\t55zMXCfkXP/ThntoxiN6Jpf69B4vMIprvXuI6GKlB5EcPzPOrJbA91VuIS7xy1sktu\n\tSvuE67CBYGm2EdYwydIZezzkAytCCWCqNfH9tIu4=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  6 Aug 2021 01:24:28 +0300",
        "Message-Id": "<20210805222436.6263-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210805222436.6263-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210805222436.6263-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 02/10] libcamera: pipeline: simple: Add\n\tsink and source pads to entity data",
        "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": "Record the sink and source pads through which an entity is traversed in\nthe list of entities stored in the camera data. This prepares for\nimplementing mutually exclusive access to entities between cameras.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/simple.cpp | 38 ++++++++++++++++++++----\n 1 file changed, 32 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b29fff9820e5..e0695d052629 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -166,7 +166,22 @@ public:\n \t}\n \n \tstruct Entity {\n+\t\t/* The media entity, always valid. */\n \t\tMediaEntity *entity;\n+\t\t/*\n+\t\t * The local sink pad connected to the upstream entity, null for\n+\t\t * the camera sensor at the beginning of the pipeline.\n+\t\t */\n+\t\tconst MediaPad *sink;\n+\t\t/*\n+\t\t * The local source pad connected to the downstream entity, null\n+\t\t * for the video node at the end of the pipeline.\n+\t\t */\n+\t\tconst MediaPad *source;\n+\t\t/*\n+\t\t * The link to the downstream entity, null for the video node at\n+\t\t * the end of the pipeline.\n+\t\t */\n \t\tMediaLink *link;\n \t};\n \n@@ -288,16 +303,18 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \t * encoders and image converters, and will end in a CSI capture device.\n \t */\n \tstd::unordered_set<MediaEntity *> visited;\n-\tstd::queue<MediaEntity *> queue;\n+\tstd::queue<std::tuple<MediaEntity *, MediaPad *>> queue;\n \n \t/* Remember at each entity where we came from. */\n \tstd::unordered_map<MediaEntity *, Entity> parents;\n \tMediaEntity *entity = nullptr;\n \n-\tqueue.push(sensor);\n+\tqueue.push({ sensor, nullptr });\n \n \twhile (!queue.empty()) {\n-\t\tentity = queue.front();\n+\t\tMediaPad *sinkPad;\n+\n+\t\tstd::tie(entity, sinkPad) = queue.front();\n \t\tqueue.pop();\n \n \t\t/* Found the capture device. */\n@@ -317,8 +334,8 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \t\t\tfor (MediaLink *link : pad->links()) {\n \t\t\t\tMediaEntity *next = link->sink()->entity();\n \t\t\t\tif (visited.find(next) == visited.end()) {\n-\t\t\t\t\tqueue.push(next);\n-\t\t\t\t\tparents.insert({ next, { entity, link } });\n+\t\t\t\t\tqueue.push({ next, link->sink() });\n+\t\t\t\t\tparents.insert({ next, { entity, sinkPad, pad, link } });\n \t\t\t\t}\n \t\t\t}\n \t\t}\n@@ -349,7 +366,16 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \tLOG(SimplePipeline, Debug)\n \t\t<< \"Found pipeline: \"\n \t\t<< utils::join(entities_, \" -> \",\n-\t\t\t       [](const Entity &e) { return e.entity->name(); });\n+\t\t\t       [](const Entity &e) {\n+\t\t\t\t       std::string s = \"[\";\n+\t\t\t\t       if (e.sink)\n+\t\t\t\t\t       s += std::to_string(e.sink->index()) + \"|\";\n+\t\t\t\t       s += e.entity->name();\n+\t\t\t\t       if (e.source)\n+\t\t\t\t\t       s += \"|\" + std::to_string(e.source->index());\n+\t\t\t\t       s += \"]\";\n+\t\t\t\t       return s;\n+\t\t\t       });\n }\n \n int SimpleCameraData::init()\n",
    "prefixes": [
        "libcamera-devel",
        "02/10"
    ]
}