Show a patch.

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

{
    "id": 3656,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/3656/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3656/",
    "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": "<20200501164332.24517-2-laurent.pinchart@ideasonboard.com>",
    "date": "2020-05-01T16:43:32",
    "name": "[libcamera-devel,2/2] libcamera: pipeline: vimc: Store media device pointer in camera data",
    "commit_ref": "4d50cc9404353810ecc890cca969cbd7dad000df",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "44f9692aab8c950ffb836d39be8a6f0dd1c2896d",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3656/mbox/",
    "series": [
        {
            "id": 868,
            "url": "https://patchwork.libcamera.org/api/1.1/series/868/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=868",
            "date": "2020-05-01T16:43:31",
            "name": "[libcamera-devel,1/2] libcamera: media_device: Expose media device API version number",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/868/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3656/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3656/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D8FBB603F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 May 2020 18:43:40 +0200 (CEST)",
            "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 567F8A24\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 May 2020 18:43:40 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CRTWNM0s\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1588351420;\n\tbh=RlJB0m82kYT+ugasHNu6E6ZBa6WgwuigBLZ72xRysm8=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=CRTWNM0s+VihUqmRJfUSLliiV8HlwFGjXT6KvLFKpoPEgT5HbqapOrlcbgOpB/1dr\n\tN6HTQ797UfZYLATefHakffzmVqEVSFDRlL3Muh0ngB0rZ3EjDEK4M54ARJlzwSM3IF\n\tlzefhbR75ffGK5OmfZvVs0wBs89dghrNQWqJoPeM=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  1 May 2020 19:43:32 +0300",
        "Message-Id": "<20200501164332.24517-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.3",
        "In-Reply-To": "<20200501164332.24517-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20200501164332.24517-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: pipeline: vimc: Store\n\tmedia device pointer in camera 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>",
        "X-List-Received-Date": "Fri, 01 May 2020 16:43:41 -0000"
    },
    "content": "Store the MediaDevice for the VIMC instance in the VimcCameraData class.\nThis will be used to check the media device version at runtime.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/vimc/vimc.cpp | 30 +++++++++++++++-------------\n 1 file changed, 16 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 339d1cf653fb..0b8a0a0c6890 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -39,9 +39,10 @@ LOG_DEFINE_CATEGORY(VIMC)\n class VimcCameraData : public CameraData\n {\n public:\n-\tVimcCameraData(PipelineHandler *pipe)\n-\t\t: CameraData(pipe), sensor_(nullptr), debayer_(nullptr),\n-\t\t  scaler_(nullptr), video_(nullptr), raw_(nullptr)\n+\tVimcCameraData(PipelineHandler *pipe, MediaDevice *media)\n+\t\t: CameraData(pipe), media_(media), sensor_(nullptr),\n+\t\t  debayer_(nullptr), scaler_(nullptr), video_(nullptr),\n+\t\t  raw_(nullptr)\n \t{\n \t}\n \n@@ -54,9 +55,10 @@ public:\n \t\tdelete raw_;\n \t}\n \n-\tint init(MediaDevice *media);\n+\tint init();\n \tvoid bufferReady(FrameBuffer *buffer);\n \n+\tMediaDevice *media_;\n \tCameraSensor *sensor_;\n \tV4L2Subdevice *debayer_;\n \tV4L2Subdevice *scaler_;\n@@ -389,7 +391,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \tif (!media)\n \t\treturn false;\n \n-\tstd::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this);\n+\tstd::unique_ptr<VimcCameraData> data = std::make_unique<VimcCameraData>(this, media);\n \n \tdata->ipa_ = IPAManager::instance()->createIPA(this, 0, 0);\n \tif (data->ipa_ != nullptr) {\n@@ -400,7 +402,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \t}\n \n \t/* Locate and open the capture video node. */\n-\tif (data->init(media))\n+\tif (data->init())\n \t\treturn false;\n \n \t/* Create and register the camera. */\n@@ -412,15 +414,15 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \treturn true;\n }\n \n-int VimcCameraData::init(MediaDevice *media)\n+int VimcCameraData::init()\n {\n \tint ret;\n \n-\tret = media->disableLinks();\n+\tret = media_->disableLinks();\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tMediaLink *link = media->link(\"Debayer B\", 1, \"Scaler\", 0);\n+\tMediaLink *link = media_->link(\"Debayer B\", 1, \"Scaler\", 0);\n \tif (!link)\n \t\treturn -ENODEV;\n \n@@ -429,26 +431,26 @@ int VimcCameraData::init(MediaDevice *media)\n \t\treturn ret;\n \n \t/* Create and open the camera sensor, debayer, scaler and video device. */\n-\tsensor_ = new CameraSensor(media->getEntityByName(\"Sensor B\"));\n+\tsensor_ = new CameraSensor(media_->getEntityByName(\"Sensor B\"));\n \tret = sensor_->init();\n \tif (ret)\n \t\treturn ret;\n \n-\tdebayer_ = new V4L2Subdevice(media->getEntityByName(\"Debayer B\"));\n+\tdebayer_ = new V4L2Subdevice(media_->getEntityByName(\"Debayer B\"));\n \tif (debayer_->open())\n \t\treturn -ENODEV;\n \n-\tscaler_ = new V4L2Subdevice(media->getEntityByName(\"Scaler\"));\n+\tscaler_ = new V4L2Subdevice(media_->getEntityByName(\"Scaler\"));\n \tif (scaler_->open())\n \t\treturn -ENODEV;\n \n-\tvideo_ = new V4L2VideoDevice(media->getEntityByName(\"RGB/YUV Capture\"));\n+\tvideo_ = new V4L2VideoDevice(media_->getEntityByName(\"RGB/YUV Capture\"));\n \tif (video_->open())\n \t\treturn -ENODEV;\n \n \tvideo_->bufferReady.connect(this, &VimcCameraData::bufferReady);\n \n-\traw_ = new V4L2VideoDevice(media->getEntityByName(\"Raw Capture 1\"));\n+\traw_ = new V4L2VideoDevice(media_->getEntityByName(\"Raw Capture 1\"));\n \tif (raw_->open())\n \t\treturn -ENODEV;\n \n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}