Show a patch.

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

{
    "id": 1502,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1502/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1502/",
    "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": "<20190621161401.28337-10-kieran.bingham@ideasonboard.com>",
    "date": "2019-06-21T16:14:01",
    "name": "[libcamera-devel,RFC,v2,9/9,PoC] QCam: Control demo: A SineWave Brightness",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b964fee38de0b0e271a21e64a3f78302facc1a7e",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1502/mbox/",
    "series": [
        {
            "id": 370,
            "url": "https://patchwork.libcamera.org/api/1.1/series/370/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=370",
            "date": "2019-06-21T16:13:52",
            "name": "Libcamera Controls",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/370/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1502/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1502/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@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 10367600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Jun 2019 18:14:09 +0200 (CEST)",
            "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A59B9E0C;\n\tFri, 21 Jun 2019 18:14:08 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1561133648;\n\tbh=Wrhp2qftXZQNb0Emd9HGLPJnBdzpg7oEbuvLHCsDqaw=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=AwWoTgoAz9LHwFYHNdU62HcqR5Y9hZ6qrwFa+KIkPNBDEmcz1qifjuLVkgYNsWFrq\n\tQGlrDB1k9yO0ol3TMg9mZ4OlqO/LfBmVM/f7b0qBhEJUSxSueopPVwBUCT868GEO99\n\tKsqs1jYQpKi+ic1ajeZcVewCiYPHvTKLEYayD+GE=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Fri, 21 Jun 2019 17:14:01 +0100",
        "Message-Id": "<20190621161401.28337-10-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190621161401.28337-1-kieran.bingham@ideasonboard.com>",
        "References": "<20190621161401.28337-1-kieran.bingham@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH v2 9/9] [PoC] QCam: Control demo: A\n\tSineWave Brightness",
        "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, 21 Jun 2019 16:14:09 -0000"
    },
    "content": "As an example of how to add a control to each request, set the\nBrightness value with a changing value against the buffer time stamps.\nThe Brightness will go up and down following a sine wave to visualise\nthe control effect on the video stream.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/qcam/main_window.cpp | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)",
    "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 8c55941f137b..1449e020c815 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -5,6 +5,7 @@\n  * main_window.cpp - qcam - Main application window\n  */\n \n+#include <cmath>\n #include <iomanip>\n #include <iostream>\n #include <string>\n@@ -219,6 +220,13 @@ void MainWindow::stopCapture()\n \tconfig_.reset();\n }\n \n+int SineWaveValue(Buffer *buffer)\n+{\n+\tunsigned int millisec = buffer->timestamp() / 1000000;\n+\tconstexpr float rads = 2 * M_PI / 180;\n+\treturn sin(0.036 * rads * millisec) * 100;\n+}\n+\n void MainWindow::requestComplete(Request *request,\n \t\t\t\t const std::map<Stream *, Buffer *> &buffers)\n {\n@@ -260,6 +268,14 @@ void MainWindow::requestComplete(Request *request,\n \t\treturn;\n \t}\n \n+\t/*\n+\t * A demonstration control, which has a distinct visual effect.\n+\t * Scale the brightness up and down with a sine wave.\n+\t */\n+\t/* How do we deal with max/min/defaults etc? */\n+\trequest->controls()[ManualBrightness] = SineWaveValue(buffer);\n+\trequest->controls().update(ManualGain, SineWaveValue(buffer));\n+\n \trequest->setBuffers(buffers);\n \tcamera_->queueRequest(request);\n }\n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "v2",
        "9/9",
        "PoC"
    ]
}