{"id":16523,"url":"https://patchwork.libcamera.org/api/1.1/patches/16523/?format=json","web_url":"https://patchwork.libcamera.org/patch/16523/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220703043704.296872-4-utkarsh02t@gmail.com>","date":"2022-07-03T04:37:04","name":"[libcamera-devel,v4,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/1.1/people/114/?format=json","name":"Utkarsh Tiwari","email":"utkarsh02t@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16523/mbox/","series":[{"id":3244,"url":"https://patchwork.libcamera.org/api/1.1/series/3244/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3244","date":"2022-07-03T04:37:01","name":"Introduce capture scripts to qcam","version":4,"mbox":"https://patchwork.libcamera.org/series/3244/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16523/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16523/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 65B87BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  3 Jul 2022 04:37:21 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 24C536564F;\n\tSun,  3 Jul 2022 06:37:21 +0200 (CEST)","from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com\n\t[IPv6:2607:f8b0:4864:20::1031])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 87DE66564A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  3 Jul 2022 06:37:17 +0200 (CEST)","by mail-pj1-x1031.google.com with SMTP id go6so6400771pjb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 02 Jul 2022 21:37:17 -0700 (PDT)","from localhost.localdomain\n\t([2406:3003:2005:1c27:2dd0:3b05:f874:d165])\n\tby smtp.gmail.com with ESMTPSA id\n\tme3-20020a17090b17c300b001ec84b0f199sm12122299pjb.1.2022.07.02.21.37.14\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 02 Jul 2022 21:37:15 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656823041;\n\tbh=FEkCk9Mw+xcHC9gOxznTZzuYzbYKnZ7km1FsOOFVeiQ=;\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=T3xlXafp3YVDW2xoNp2f2934iu0HBel9eANWz/eismiK3wKvEFmStmVSsP7uJ0a9i\n\t8DW2TASy3yPV75Dw8qgMCLU0bw+fwc0hIaz7judM2RBPMtHoACVkWoTapdp0tTo0o6\n\tz0fd4yzTXWlrLnqX4ziPBpW7mDGGyDMN13w+58rd0TRergUyg/6iTVbQMLw1PmqXJz\n\tDl7ZPVDyn8OE30AJ7bHjHFYlCMgpFkJMUPx0jRX9S0dOoUz0R66ONS30xfILnEg7WV\n\t02qmZ5VHetk6v88Xlm82fL7ADQUjxFIxqw8TZiieYCE8BSJw3Yu6QJNPFbufKAY/5t\n\tc/8Pm5RphZ3xA==","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=SojkkV1KgZHtRwZYehZcIeNN0EHB8sfznzvDHI1YuLw=;\n\tb=E4hSxFaCHwRas0sZ+2PPjfHzUb5m0Zlha038lP1C3/nmq/Pyj+zOoE51fXCZL7oKO8\n\tBnpzSeG+wEITyamufE7Ic+xpfxZ4aGyvbxvPX6qsRZLxwAAa4V7Z+PfsZituVd3BYdGZ\n\tDfL2WmbrSI8b9nUc/GQK8aDuFoSyVFFcR3YLf/M8D8+O9FgkG5qLnIqKENjboP6vwgvI\n\tGvbl97PxT0dRpKNVqtWIDLW8MDFW9L5pqt7r8aSdty8HARoqZQasujpMa1Fut9OCfEyj\n\t6V7urtl5wphOF+L7iWXeq2w+/9FV3q79z9LQVBp6Xs1fwgtlnLgDfzF56/r+m5GBqIP1\n\tfaLA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"E4hSxFaC\"; 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=SojkkV1KgZHtRwZYehZcIeNN0EHB8sfznzvDHI1YuLw=;\n\tb=avFCRBncy5hWKXB2Q8lH7fki23l9cs/vdcxjiftGI1egWqKguK+25t8pQwI1Wy3pSA\n\tSUMYftZFSc6hegVBQbK+AnqyFJ4XUcdkShwFdTspld6Iqufc7EZjFqMdF6dnfqCrk2B5\n\tXdVYGfb79KfvfXSrAT0r35bNuXJCUQMbZR+Ljy+wuGQIJgx057za5kMujC7nx3OyfXTe\n\tBz7/+QLe3A3mwXjVH8hXx9HWl4xutEfqUay5TCQ8Y7s4/KRsI0g2Rhq0oU7gIG7s/dW9\n\t/D5LcpBoafv1oZJoFTMA7+0DlM0DNVDod/sD69gAmUnJDBzVDC0QtIXpNJXF+NpPB2tB\n\tYeRw==","X-Gm-Message-State":"AJIora8om+VottFDD+5rOjiw3KsXjc970tNKvzuABnUeK6uLb1RH12Av\n\tU+TisZheQdIDUAtRoAFA7z3JArI11lzUcA==","X-Google-Smtp-Source":"AGRyM1tjwyyN7+qasJmlN9rhbLsJsAee2J77T0gURl8Bug9nfSXX5SYrwXKoIHtHpKJE9fe+gKmquQ==","X-Received":"by 2002:a17:902:f68f:b0:16a:7a95:466c with SMTP id\n\tl15-20020a170902f68f00b0016a7a95466cmr28187165plg.86.1656823035921; \n\tSat, 02 Jul 2022 21:37:15 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Sun,  3 Jul 2022 12:37:04 +0800","Message-Id":"<20220703043704.296872-4-utkarsh02t@gmail.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220703043704.296872-1-utkarsh02t@gmail.com>","References":"<20220703043704.296872-1-utkarsh02t@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.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 4fbaeccc..7ec53a7c 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","v4","3/3"]}