Show a patch.

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

{
    "id": 9851,
    "url": "https://patchwork.libcamera.org/api/patches/9851/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9851/",
    "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": "<20200929014334.49719-7-niklas.soderlund@ragnatech.se>",
    "date": "2020-09-29T01:43:33",
    "name": "[libcamera-devel,v4,6/7] libcamera: pipeline: rkisp1: Move path link handling to RkISP1Path",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "f4785b85b2d7e431e721ad3c427c4d3d6454138e",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9851/mbox/",
    "series": [
        {
            "id": 1333,
            "url": "https://patchwork.libcamera.org/api/series/1333/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1333",
            "date": "2020-09-29T01:43:27",
            "name": "libcamera: pipeline: rkisp1: Create RkISP1Path helper",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/1333/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9851/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9851/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 D8B18C3B5B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Sep 2020 01:43:58 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B494862140;\n\tTue, 29 Sep 2020 03:43:58 +0200 (CEST)",
            "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D0E460BD4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Sep 2020 03:43:55 +0200 (CEST)",
            "from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de\n\t[84.172.82.168]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 39da3677-01f5-11eb-b295-0050569116f7;\n\tTue, 29 Sep 2020 03:43:51 +0200 (CEST)"
        ],
        "X-Halon-ID": "39da3677-01f5-11eb-b295-0050569116f7",
        "Authorized-sender": "niklas.soderlund@fsdn.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 29 Sep 2020 03:43:33 +0200",
        "Message-Id": "<20200929014334.49719-7-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20200929014334.49719-1-niklas.soderlund@ragnatech.se>",
        "References": "<20200929014334.49719-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v4 6/7] libcamera: pipeline: rkisp1: Move\n\tpath link handling to RkISP1Path",
        "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>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Move the path link handling to RkISP1Path, there is no functional\nchange.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n* Changes since v3\n- Rename enable() to setEnabled(bool enable) to make it less confusing\n  for users.\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 11 ++---------\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp |  6 +++++-\n src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  4 ++++\n 3 files changed, 11 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 2eaf7b491d13397b..72593a06b0f502b0 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -1010,20 +1010,13 @@ int PipelineHandlerRkISP1::initLinks(const Camera *camera,\n \t}\n \n \tfor (const StreamConfiguration &cfg : config) {\n-\t\tMediaLink *link;\n \t\tif (cfg.stream() == &data->mainPathStream_)\n-\t\t\tlink = media_->link(\"rkisp1_isp\", 2,\n-\t\t\t\t\t    \"rkisp1_resizer_mainpath\", 0);\n+\t\t\tret = data->mainPath_->setEnabled(true);\n \t\telse if (cfg.stream() == &data->selfPathStream_)\n-\t\t\tlink = media_->link(\"rkisp1_isp\", 2,\n-\t\t\t\t\t    \"rkisp1_resizer_selfpath\", 0);\n+\t\t\tret = data->selfPath_->setEnabled(true);\n \t\telse\n \t\t\treturn -EINVAL;\n \n-\t\tif (!link)\n-\t\t\treturn -ENODEV;\n-\n-\t\tret = link->setEnabled(true);\n \t\tif (ret < 0)\n \t\t\treturn ret;\n \t}\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex 9f1706c78f41465b..0ce133dd04048cbb 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -22,7 +22,7 @@ RkISP1Path::RkISP1Path(const char *name, const Span<const PixelFormat> &formats,\n \t\t       const Size &minResolution, const Size &maxResolution)\n \t: name_(name), running_(false), formats_(formats),\n \t  minResolution_(minResolution), maxResolution_(maxResolution),\n-\t  resizer_(nullptr), video_(nullptr)\n+\t  resizer_(nullptr), video_(nullptr), link_(nullptr)\n {\n }\n \n@@ -45,6 +45,10 @@ bool RkISP1Path::init(MediaDevice *media)\n \tif (video_->open() < 0)\n \t\treturn false;\n \n+\tlink_ = media->link(\"rkisp1_isp\", 2, resizer, 0);\n+\tif (!link_)\n+\t\treturn false;\n+\n \treturn true;\n }\n \ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex e2eb1be9a445ba41..98863a2e693729be 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -15,6 +15,7 @@\n #include <libcamera/signal.h>\n #include <libcamera/span.h>\n \n+#include \"libcamera/internal/media_object.h\"\n #include \"libcamera/internal/v4l2_videodevice.h\"\n \n namespace libcamera {\n@@ -33,6 +34,8 @@ public:\n \n \tbool init(MediaDevice *media);\n \n+\tint setEnabled(bool enable) { return link_->setEnabled(enable); }\n+\n \tStreamConfiguration generateConfiguration(const Size &resolution);\n \tCameraConfiguration::Status validate(StreamConfiguration *cfg);\n \n@@ -63,6 +66,7 @@ private:\n \n \tV4L2Subdevice *resizer_;\n \tV4L2VideoDevice *video_;\n+\tMediaLink *link_;\n };\n \n class RkISP1MainPath : public RkISP1Path\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "6/7"
    ]
}