Show a patch.

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

{
    "id": 17074,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17074/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17074/",
    "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": "<20220810150349.414043-9-utkarsh02t@gmail.com>",
    "date": "2022-08-10T15:03:49",
    "name": "[libcamera-devel,v8,8/8] qcam: Add --script to load capture script",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5a47119e8a2539c6905ff7c229d67249e4a3fd2e",
    "submitter": {
        "id": 114,
        "url": "https://patchwork.libcamera.org/api/1.1/people/114/?format=api",
        "name": "Utkarsh Tiwari",
        "email": "utkarsh02t@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17074/mbox/",
    "series": [
        {
            "id": 3402,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3402/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3402",
            "date": "2022-08-10T15:03:41",
            "name": "Introduce capture scripts to qcam",
            "version": 8,
            "mbox": "https://patchwork.libcamera.org/series/3402/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17074/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17074/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 E8806C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Aug 2022 15:04:16 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4E9D63330;\n\tWed, 10 Aug 2022 17:04:16 +0200 (CEST)",
            "from mail-pl1-x630.google.com (mail-pl1-x630.google.com\n\t[IPv6:2607:f8b0:4864:20::630])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 58B3663342\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 17:04:14 +0200 (CEST)",
            "by mail-pl1-x630.google.com with SMTP id m2so14497411pls.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Aug 2022 08:04:14 -0700 (PDT)",
            "from localhost.localdomain ([2404:bd00:3:d2bc:2a55:4cae:bf8f:f4ed])\n\tby smtp.gmail.com with ESMTPSA id\n\tb3-20020a1709027e0300b0016f1319d2a7sm12882624plm.297.2022.08.10.08.04.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 10 Aug 2022 08:04:12 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660143856;\n\tbh=Gissg3Kolnsi/wJV5FavEAiRINqNVr57p7i3yoAwTvg=;\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=0j/kmbjag4yzKg5CDcofYgNjuV62lNZJIICtT/89vxf02i/DdiT3xmWgmOtorTXig\n\toJsqaiP/yVT3oO8Ob3S+UJXGaHyOPG9m0hjsR887IKEEyFtkGSnAxPJSYO0qG5naoL\n\tSlOhiJoGiwEx9I59BGTldFhjeulrsoECqwuj+fllAq8CnbPvJ6byOrlV+9TDOlF/pq\n\tkK2R0NVZSxOMw40TiORRXC8yHdX+YRUatJ0b2eXhijSHMp/EOlNvywNGSnWr4M+Hh8\n\tZXiNOuQ5mSN8RGp6+TFp+YyLGPP9+pCxQ6UA/dsxBpREPnk34Htp/H1fssqf7ZLgah\n\typFf7A8TaroOQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc;\n\tbh=JJ6VsRgjEyvXjTIL05vJUEogvTNW4TalPItR7UT8ois=;\n\tb=R87G+CFloViHwgUMYWPd20mpy7gf7auhi8dLdSYcyS+HCu0FAMbQ7LH9vaQjfLsp5q\n\t+1A6fTKOUJvzXk2cW+aMY8hD+fRzc7osrMX/IoeClTNsr4UWS3jNyE/EfpQ/wkwNk3rk\n\tdnfhupwWtw5q3FTXP5P01nyfmVHvUSmu04fyVsjQYvBcJGlP73Eh2GI/ieQkggRXZGWV\n\tFG67meb8u42gzZTdUR4rri6uF/CD1LtXR8/vI48BwlsVn2qD8VGsJfoGfcA5Rv2/R6E2\n\toVkbkveuUHZ4nfQmdzVwNYiSKsNuR7yUYyBq9qRznxb47Jl6if0IZqSb+A2APhCxnYfL\n\t3Ukw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"R87G+CFl\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc;\n\tbh=JJ6VsRgjEyvXjTIL05vJUEogvTNW4TalPItR7UT8ois=;\n\tb=ZP7N1mJMhdjLn/jeoxwaxMNtGaWJdzZIng841DxgcMAIf+9IrUNwJrx0YjXqZwC9Xi\n\tgToLTmQ+LNadgX2FuLPa4lODI6R4+noapxU9GJp77fDxumqBEL5itbhoyUNNCUoLQO4L\n\tIh2QMrjUwWGKTFAqyTT4hiknX3outlJ+pJ+cD+BHDTArgUZ/xAwMXcPQj+eFNyenjIYI\n\tf7pWr8hHoxaOz7MKE07HSmmG8bgdugDJKWsLVBkua3CvYvKcmZMn0lOYMvnN3tac/nmL\n\t+L1G0gIu/mqip/JbYo4Ts30flsCzCZ2d/gDkxLGFAsfdH0zph1pSg7Vc3lkSTQMUQgxc\n\tn4aA==",
        "X-Gm-Message-State": "ACgBeo0AzrIZTv1RJPZATEhnJSawgYzZmpgVBjw1Jd8WSdWwIA5b4X3p\n\tfjQoX/cfyzeSvLh21U2gCuFLkjjKQwk=",
        "X-Google-Smtp-Source": "AA6agR7BILm1lOVHvCp5q3aCGd3xYo3e70KiBF/+V1vbC0jcj3GZur9gUeD8/2w4Sa3GljVAzELkUg==",
        "X-Received": "by 2002:a17:903:40ca:b0:170:5b7a:a7c4 with SMTP id\n\tt10-20020a17090340ca00b001705b7aa7c4mr22675879pld.108.1660143852762; \n\tWed, 10 Aug 2022 08:04:12 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 10 Aug 2022 20:33:49 +0530",
        "Message-Id": "<20220810150349.414043-9-utkarsh02t@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "References": "<20220810150349.414043-1-utkarsh02t@gmail.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v8 8/8] 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, display an critical error\nQMessageBox and close the application.\n\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\n---\nDifference from v7:\n\t1. Moved firstCameraSelect_ to 3/8\n src/qcam/main.cpp        |  3 +++\n src/qcam/main_window.cpp | 10 ++++++++++\n src/qcam/main_window.h   |  1 +\n 3 files changed, 14 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 753e1af9..ce70cc02 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -147,6 +147,9 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)\n \tcm_->cameraAdded.connect(this, &MainWindow::addCamera);\n \tcm_->cameraRemoved.connect(this, &MainWindow::removeCamera);\n \n+\tif (options_.isSet(OptCaptureScript))\n+\t\tscriptPath_ = options_[OptCaptureScript].toString();\n+\n \t/* Open the camera and start capture. */\n \tret = openCamera();\n \tif (ret < 0) {\n@@ -325,6 +328,13 @@ void MainWindow::loadCaptureScript()\n \t\tQMessageBox::critical(this, \"Invalid Script\",\n \t\t\t\t      \"Couldn't load the capture script\");\n \n+\t\t/*\n+\t\t * Close the camera if started by command line and its the first capture\n+\t\t * script.\n+\t\t */\n+\t\tif (firstCameraSelect_ && options_.isSet(OptCaptureScript))\n+\t\t\tquit();\n+\n \t} else\n \t\tcameraSelectorDialog_->informScriptRunning(scriptPath_);\n \ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex 10994b67..c7cba5e9 100644\n--- a/src/qcam/main_window.h\n+++ b/src/qcam/main_window.h\n@@ -45,6 +45,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",
        "v8",
        "8/8"
    ]
}