Show a patch.

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

{
    "id": 16374,
    "url": "https://patchwork.libcamera.org/api/patches/16374/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16374/",
    "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": "<20220627030159.30730-4-utkarsh02t@gmail.com>",
    "date": "2022-06-27T03:01:59",
    "name": "[libcamera-devel,v3,3/3] qcam: Add --script to load capture script",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "51b207d9591935381a8ed28dbd3ad363510b9128",
    "submitter": {
        "id": 114,
        "url": "https://patchwork.libcamera.org/api/people/114/?format=api",
        "name": "Utkarsh Tiwari",
        "email": "utkarsh02t@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/16374/mbox/",
    "series": [
        {
            "id": 3220,
            "url": "https://patchwork.libcamera.org/api/series/3220/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3220",
            "date": "2022-06-27T03:01:56",
            "name": "Introduce capture scripts to qcam",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3220/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16374/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16374/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 F3DA3BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 27 Jun 2022 03:02:18 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 97DAF6563D;\n\tMon, 27 Jun 2022 05:02:18 +0200 (CEST)",
            "from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8096D65641\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 27 Jun 2022 05:02:17 +0200 (CEST)",
            "by mail-pj1-x1029.google.com with SMTP id\n\tg10-20020a17090a708a00b001ea8aadd42bso8133264pjk.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 26 Jun 2022 20:02:17 -0700 (PDT)",
            "from localhost.localdomain\n\t([2406:3003:2005:1c27:cf57:31af:7925:f9e6])\n\tby smtp.gmail.com with ESMTPSA id\n\ts7-20020aa78d47000000b0051bba89c2bcsm5899378pfe.58.2022.06.26.20.02.13\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 26 Jun 2022 20:02:14 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656298938;\n\tbh=nJwrVPR4ZAlnfmWMTSQFRPq2klsrAV5yBzQQtDaVMjE=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Wlw5aTfQcFyrO8yH9jAF+TycTZZLy/wbjX3vNNdGNWrsVTa7lB/f6c9ZYKNb1k4lS\n\tumRI+MFibFv0x14vB1sG/NT4VcBEdvU4rs8Jj+gqRaRNOuOBLorMB5zB1UNNhv3tZZ\n\teksn4vOTXQoUJ24ARThrZRtYzmi5HxKk9gNp+epC+7Mj2w6Yka7ocYn5VJFKLrHySt\n\t7cM1v0Ls2w4XSdbAlJz5Rxo2wOZ40cIZGherYdAefVM3Rv4LAphVrktJtM1hxZPh2J\n\tAE1ESx2i45K0eq0htJe6IBXZhS19/BaCWZry2TDs1geysihlAFeYO4T/iWAaj02Dfb\n\tBZTBDlTiXChxQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=wiQrIUZLI0w8Ss0m5XfMh2KHeapw8RY7kWyrjafNGrs=;\n\tb=JSTdbL0A/MJbgBjSXoOlohzqDJzrH9AIDJIjMVDsu2Ilxz1ebYrhGpBq50rMSIsk8q\n\tBoofUQJk0IW+Hg9tmJhZk0g9vFWhRnzOgL6O25JTJV1x6IODaOUvf+zh6oXRjR3Acy2g\n\tEDiIDqyZlwObt9s7MII4MFQ0vuTQ1fx/ZCofec/dWJs/r5mgS8Q6ePAfEHxKHp6qO4jn\n\tW4UQf/pOY0z4r5hTBd6DW1saBLz1f2qKF0NuqvjtSUlNuIjuzAEQxMUXLbXLeoo1axye\n\tYgXgjHujOtXyVoMoaQhNUELyhSxmLumpT0UOsxuPDB8b/z/TMJV5rvKOzhbfWq3RpOGe\n\tBpBw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"JSTdbL0A\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=wiQrIUZLI0w8Ss0m5XfMh2KHeapw8RY7kWyrjafNGrs=;\n\tb=UA6lbclqx5uuAXjeJqI7lRpjv6eY7xRUZl0Rfloena3U24Z87xUQs4Fk5aw3ReyFHU\n\tB/JWpvDe1tMl6MOKPyA58Px8Q496XrwsXUf40dPYC8SLB4uzEgCpesIwGmXnO76UutI7\n\t1oagXiAIrRn9viaaRs6C0fJ2C6ey8rVMgBw/SIeOw5er4hGELEI/wn9csNq9c9tGEfg5\n\trxUqf6p2jgkuo9QQJXsQznM2HlHE1wXhj3K56PfVNxt3ECX03l1regjoBduOP5mXhzRw\n\tXgucfVYlWGgWDP+/xED5kfjp7EN6QXv7xyoo9jXvfak9KO5xHzyj6GosiSGSI4r4sUJp\n\t+/YQ==",
        "X-Gm-Message-State": "AJIora97CBVCoeajS0JqBIiByr6EaC6TiEn/nHTRHwSxFM5axomr1E6c\n\tU9urobZJPt7MfKozQZ7e7MR8yUO1TjrUFg==",
        "X-Google-Smtp-Source": "AGRyM1vAFKloXMmH18K9g1uaFokSkfzk3hdSCwZdKF4cMNsJSIqbq2SvTGu1Tu29mHKvr2VI9OFvAw==",
        "X-Received": "by 2002:a17:90b:895:b0:1ec:827c:ef0f with SMTP id\n\tbj21-20020a17090b089500b001ec827cef0fmr18040743pjb.10.1656298935770; \n\tSun, 26 Jun 2022 20:02:15 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 27 Jun 2022 11:01:59 +0800",
        "Message-Id": "<20220627030159.30730-4-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220627030159.30730-1-utkarsh02t@gmail.com>",
        "References": "<20220627030159.30730-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 3/3] qcam: Add --script to load capture\n\tscript",
        "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>",
        "From": "Utkarsh Tiwari via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Utkarsh Tiwari <utkarsh02t@gmail.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add --script as an individual option to load capture scripts.\nLoad the capture script before starting the capture.\n\nIf an invalid capture script has been given, show error\nbut start the capture without the script.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\n---\n src/qcam/main.cpp        |  3 +++\n src/qcam/main_window.cpp | 14 ++++++++++++++\n src/qcam/main_window.h   |  1 +\n 3 files changed, 18 insertions(+)",
    "diff": "diff --git a/src/qcam/main.cpp b/src/qcam/main.cpp\nindex d3f01a85..91166be5 100644\n--- a/src/qcam/main.cpp\n+++ b/src/qcam/main.cpp\n@@ -43,6 +43,9 @@ OptionsParser::Options parseOptions(int argc, char *argv[])\n \t\t\t \"Set configuration of a camera stream\", \"stream\", true);\n \tparser.addOption(OptVerbose, OptionNone,\n \t\t\t \"Print verbose log messages\", \"verbose\");\n+\tparser.addOption(OptCaptureScript, OptionString,\n+\t\t\t \"Load a capture session configuration script from a file\",\n+\t\t\t \"script\", ArgumentRequired, \"script\");\n \n \tOptionsParser::Options options = parser.parse(argc, argv);\n \tif (options.isSet(OptHelp))\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex e133b618..8e6bde32 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -151,6 +151,20 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)\n \t\treturn;\n \t}\n \n+\tif (options_.isSet(OptCaptureScript)) {\n+\t\tstd::string scriptName = options_[OptCaptureScript].toString();\n+\t\tscript_ = std::make_unique<CaptureScript>(camera_, scriptName);\n+\t\tif (!script_->valid()) {\n+\t\t\tQMessageBox::critical(this, \"Invalid Script\",\n+\t\t\t\t\t      \"Couldn't load the capture script\");\n+\t\t\tscript_.reset();\n+\t\t}\n+\n+\t\t/* Show stopping availability. */\n+\t\tscriptExecAction_->setIcon(QIcon(\":x-square.svg\"));\n+\t\tscriptExecAction_->setText(\"Stop Script execution\");\n+\t}\n+\n \tstartStopAction_->setChecked(true);\n }\n \ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex 2cdf7169..4d19ab64 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -42,6 +42,7 @@ enum {\n \tOptRenderer = 'r',\n \tOptStream = 's',\n \tOptVerbose = 'v',\n+\tOptCaptureScript = 256,\n };\n \n class MainWindow : public QMainWindow\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "3/3"
    ]
}