Show a patch.

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

{
    "id": 16206,
    "url": "https://patchwork.libcamera.org/api/patches/16206/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16206/",
    "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": "<20220613060345.229191-4-utkarsh02t@gmail.com>",
    "date": "2022-06-13T06:03:45",
    "name": "[libcamera-devel,3/3] qcam: Add --script to load capture script",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "20b0e1f2090b6e1bee50d287d58352e6d1925f65",
    "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/16206/mbox/",
    "series": [
        {
            "id": 3171,
            "url": "https://patchwork.libcamera.org/api/series/3171/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3171",
            "date": "2022-06-13T06:03:42",
            "name": "Introduce capture scripts to qcam",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3171/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16206/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16206/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 7E585C3274\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 13 Jun 2022 06:04:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B489E6563E;\n\tMon, 13 Jun 2022 08:04:07 +0200 (CEST)",
            "from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com\n\t[IPv6:2607:f8b0:4864:20::52d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3F7466563E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 13 Jun 2022 08:04:06 +0200 (CEST)",
            "by mail-pg1-x52d.google.com with SMTP id 184so4647069pga.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 12 Jun 2022 23:04:06 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d6be:8959:67fc:32d7:74a0])\n\tby smtp.gmail.com with ESMTPSA id\n\tx14-20020a170902a38e00b00161478027f5sm4087908pla.150.2022.06.12.23.04.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 12 Jun 2022 23:04:04 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655100247;\n\tbh=BR26+Qfh/haE7n/DaiYRKsM8haJxNwEqkfCNlDDuOZw=;\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=EngU3zCFdaTv3dA9XCUEOtSaQc7ew4a3rtgkC5Fsh6iDqdZFogjcC/jjJenCW4gIm\n\tGD4BX3JuVEAYfCt2tHjit2UbSKkEnrsrVJ1ScbDfO7CVRqZRtJFXiWyTY5/IdGCczJ\n\tweE3lWYGrjgId3LykpImJsEwpIuwlvYE8qhDupXeoGiEZPXbeMy72ayvtm7+E14jaU\n\tgyXZI7WzorRTuXX0UOUKXwbQK2BiO5mN3EPA5R0//xz1dG0Ll3VD0X3kCpzFA5ukH7\n\tFDonoK+87U1qps5R695v+s7AsoA784Zfaq6t3pif549f5fIHQj9bhCiAYXB4bBlW6k\n\tm2KVDi5FWkm1w==",
            "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=ON1TEMaclXDPe4+rXHPXrcEfPxpF3oTltgaPHX1Y9nw=;\n\tb=d1i+p0HtYW6ogTLqxqqddx7q4VHF8FF7LzOc3rgT18aliYwfEQj1AK4sOzLKJkzUNT\n\t4Ul52pVG88FnzOw0nkvWDi3ENISBuWulHsFS5G0wsyNi3rLUNDg1l7X5AZFm+HeUcZDx\n\tLBkJiOkGzzEPNBL7iVmNIiv9CPLJsBZWpii0NIXEx/HhJ3DCf0oriT0QgEl/AGEXtCtp\n\tdc9DoPQrfSLVKcBtlzcS7LSfNiRB4Q5BxJBAsoL30fAUSgAVksZoAPz/f2CfNTay3T35\n\t0yWXOWH9FYCeZjhL7SRPkoemcfGiO3m/UtbbYHf6fSN2JYE12T0Miy0tehDuUzxDtUxL\n\tkvBA=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"d1i+p0Ht\"; 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=ON1TEMaclXDPe4+rXHPXrcEfPxpF3oTltgaPHX1Y9nw=;\n\tb=o8McUAKfJay/QquxhKCseptUX181tBEU2zB6TPqqqEtpDocWCBOLojtLASx7LGQ/4q\n\tB0R5HJG2sm3O33KvgnHaKzyFHQsxbaGaW3Yw8G9uL3/nG4c1IEVhSwFFwwB/wHqIUOlv\n\tx0R+u8FqU5zYindcIjxd2Ya90gBSOwkdM5eZQ8PnUaBHu5jcP8i7uSMfHM3P5t1W/kP3\n\tNKTEKU7HVcy2sEvIGfbGrdTmKV5bfvetsB41ONpNWNqzfo9LY8KlsirG/H+S7tSxFeIp\n\tV6TGgYYv0mqgT3MCw9Ei1r0tQ22DC7k8GLqc6fxo+y3B2Gm6AfqsRbgxyBv56ezFsjaQ\n\tTbcA==",
        "X-Gm-Message-State": "AOAM530AD4O3zZKrVUQ+nOwLSkIzeb/U9U2HOlnuFQOcvg/Y2Nr6aWor\n\tavWV77yKtARvC6D1ljoaS7Ej/yVpGb8=",
        "X-Google-Smtp-Source": "ABdhPJy9ic6OQs3E2P/FQjTvtjGTmxZ4PIqlW/NXPvjmmPljr20D/HuvFT+wTJ1wShs619RKI4qlXQ==",
        "X-Received": "by 2002:a63:d202:0:b0:3fe:4c06:ca76 with SMTP id\n\ta2-20020a63d202000000b003fe4c06ca76mr20471335pgg.227.1655100244566; \n\tSun, 12 Jun 2022 23:04:04 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 13 Jun 2022 11:33:45 +0530",
        "Message-Id": "<20220613060345.229191-4-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220613060345.229191-1-utkarsh02t@gmail.com>",
        "References": "<20220613060345.229191-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 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. Load the capture script before starting the capture.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\n---\n src/qcam/main.cpp        | 3 +++\n src/qcam/main_window.cpp | 9 +++++++++\n src/qcam/main_window.h   | 1 +\n 3 files changed, 13 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 7cdb1238..b9bf5b04 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -151,6 +151,15 @@ 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, tr(\"Invalid Script\"), tr(\"Couldn't execute the capture script\"));\n+\t\t\tscript_.reset();\n+\t\t}\n+\t}\n+\n \tstartStopAction_->setChecked(true);\n }\n \ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex cde5842f..45069b0e 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",
        "3/3"
    ]
}