Patch Detail
Show a patch.
GET /api/1.1/patches/1377/?format=api
{ "id": 1377, "url": "https://patchwork.libcamera.org/api/1.1/patches/1377/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1377/", "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": "<20190606205654.9311-6-kieran.bingham@ideasonboard.com>", "date": "2019-06-06T20:56:54", "name": "[libcamera-devel,RFC,5/5,PoC] QCam: Control demo: A SineWave Brightness", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0d94af894ad3c739205d9ea19c87a7ecf278b7b7", "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/1377/mbox/", "series": [ { "id": 340, "url": "https://patchwork.libcamera.org/api/1.1/series/340/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=340", "date": "2019-06-06T20:56:49", "name": "Libcamera Controls", "version": 1, "mbox": "https://patchwork.libcamera.org/series/340/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1377/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1377/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 65AC560BB7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 6 Jun 2019 22:56:59 +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 04126549;\n\tThu, 6 Jun 2019 22:56:58 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559854619;\n\tbh=cqMsU/6hFBve0kvWuImzIiMDPL6s6Fy7ubS3FYzOpTM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qjf4PR3pwEh219UGOVRYA7CsDAG4qD+Q7CWHf/VrUj9xDYdUA50bdpqqimf+b5Yhv\n\tfwPT35TM5jpNf7tt5ZIxQvhgolTD4lx9kxYbN6QxtqjyL81Kk3piTJdxmtA6W7RTLG\n\tr1eyGsqthF2KLCDsr8ChgguGftm9wSYkuV1p34Ig=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>", "Date": "Thu, 6 Jun 2019 21:56:54 +0100", "Message-Id": "<20190606205654.9311-6-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190606205654.9311-1-kieran.bingham@ideasonboard.com>", "References": "<20190606205654.9311-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [RFC PATCH 5/5] [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": "Thu, 06 Jun 2019 20:56:59 -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 | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)", "diff": "diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 8dbe597e7aa2..d3fedce20a9c 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@@ -247,6 +248,13 @@ void MainWindow::stopCapture()\n \tconfig_.reset();\n }\n \n+int SineBrightness(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@@ -281,6 +289,12 @@ 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().emplace(ManualBrightness, SineBrightness(buffer));\n \n \trequest->setBuffers(buffers);\n \tcamera_->queueRequest(request);\n", "prefixes": [ "libcamera-devel", "RFC", "5/5", "PoC" ] }