Show a patch.

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

{
    "id": 11475,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/11475/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11475/",
    "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": "<20210303141644.10873-1-dafna.hirschfeld@collabora.com>",
    "date": "2021-03-03T14:16:44",
    "name": "[libcamera-devel] libcamera: pipeline: simple: walk the pipline by following the first link",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6b50bb43db8d20c680790fb4459d5767a816912b",
    "submitter": {
        "id": 46,
        "url": "https://patchwork.libcamera.org/api/1.1/people/46/?format=api",
        "name": "Dafna Hirschfeld",
        "email": "dafna.hirschfeld@collabora.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11475/mbox/",
    "series": [
        {
            "id": 1750,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1750/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1750",
            "date": "2021-03-03T14:16:44",
            "name": "[libcamera-devel] libcamera: pipeline: simple: walk the pipline by following the first link",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1750/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11475/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11475/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 DDF63BD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Mar 2021 14:16:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6D6A068A91;\n\tWed,  3 Mar 2021 15:16:55 +0100 (CET)",
            "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E4D6B68A7E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Mar 2021 15:16:53 +0100 (CET)",
            "from guri.fritz.box\n\t(p200300c7cf3838007d25342b1528aa90.dip0.t-ipconnect.de\n\t[IPv6:2003:c7:cf38:3800:7d25:342b:1528:aa90])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: dafna)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 5A4231F45D4E;\n\tWed,  3 Mar 2021 14:16:53 +0000 (GMT)"
        ],
        "From": "Dafna Hirschfeld <dafna.hirschfeld@collabora.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  3 Mar 2021 15:16:44 +0100",
        "Message-Id": "<20210303141644.10873-1-dafna.hirschfeld@collabora.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "Subject": "[libcamera-devel] [PATCH] libcamera: pipeline: simple: walk the\n\tpipline by following the first link",
        "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>",
        "Cc": "kernel@collabora.com",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When walking the pipeline, follow the first link of each\nsource pad.\nThis patch removes a redundant condition for choosing the link:\n\n\"(link->flags() & MEDIA_LNK_FL_ENABLED) ||\n !(link->flags() & MEDIA_LNK_FL_IMMUTABLE)\"\n\nsince it always returns true.\n\nSigned-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>\n---\n\nNote, I could only make sure that the patch compiles, but I don't have\nthe hardware to test it.\n\n src/libcamera/pipeline/simple/simple.cpp | 23 ++++++-----------------\n 1 file changed, 6 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 7fba495c..1aeabcf7 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -279,12 +279,17 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \t\tif (source->function() == MEDIA_ENT_F_IO_V4L)\n \t\t\tbreak;\n \n-\t\t/* Use the first output pad that has links. */\n+\t\t/*\n+\t\t * Use the first output pad that has links and follow its first\n+\t\t * link.\n+\t\t */\n \t\tMediaPad *sourcePad = nullptr;\n+\t\tMediaLink *sourceLink = nullptr;\n \t\tfor (MediaPad *pad : source->pads()) {\n \t\t\tif ((pad->flags() & MEDIA_PAD_FL_SOURCE) &&\n \t\t\t    !pad->links().empty()) {\n \t\t\t\tsourcePad = pad;\n+\t\t\t\tsourceLink = pad->links().front();\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n@@ -292,22 +297,6 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n \t\tif (!sourcePad)\n \t\t\treturn;\n \n-\t\t/*\n-\t\t * Use the first link that is enabled or can be enabled (not\n-\t\t * immutable).\n-\t\t */\n-\t\tMediaLink *sourceLink = nullptr;\n-\t\tfor (MediaLink *link : sourcePad->links()) {\n-\t\t\tif ((link->flags() & MEDIA_LNK_FL_ENABLED) ||\n-\t\t\t    !(link->flags() & MEDIA_LNK_FL_IMMUTABLE)) {\n-\t\t\t\tsourceLink = link;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\n-\t\tif (!sourceLink)\n-\t\t\treturn;\n-\n \t\tentities_.push_back({ source, sourceLink });\n \n \t\tsource = sourceLink->sink()->entity();\n",
    "prefixes": [
        "libcamera-devel"
    ]
}