{"id":16320,"url":"https://patchwork.libcamera.org/api/patches/16320/?format=json","web_url":"https://patchwork.libcamera.org/patch/16320/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20220622131638.79122-4-utkarsh02t@gmail.com>","date":"2022-06-22T13:16:38","name":"[libcamera-devel,v2,3/3] qcam: Add --script to load capture script","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"eaed9abaf3be297c4738fbe8a8c8ef0e2467b221","submitter":{"id":114,"url":"https://patchwork.libcamera.org/api/people/114/?format=json","name":"Utkarsh Tiwari","email":"utkarsh02t@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16320/mbox/","series":[{"id":3204,"url":"https://patchwork.libcamera.org/api/series/3204/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3204","date":"2022-06-22T13:16:35","name":"Introduce capture scripts to qcam","version":2,"mbox":"https://patchwork.libcamera.org/series/3204/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16320/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16320/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 85217BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Jun 2022 13:17:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3C1FA65640;\n\tWed, 22 Jun 2022 15:17:36 +0200 (CEST)","from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n\t[IPv6:2607:f8b0:4864:20::1036])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8B9465639\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jun 2022 15:17:34 +0200 (CEST)","by mail-pj1-x1036.google.com with SMTP id p5so10189317pjt.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Jun 2022 06:17:34 -0700 (PDT)","from localhost.localdomain\n\t([2406:3003:2005:1f6b:fd12:eca1:fe45:bbdb])\n\tby smtp.gmail.com with ESMTPSA id\n\tx82-20020a627c55000000b0052089e1b88esm7124540pfc.192.2022.06.22.06.17.29\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Jun 2022 06:17:30 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1655903856;\n\tbh=Hw0bTFcArbGH3QjhfHrHCqlJeBV4ipe2g8lAthiGb1k=;\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=DpUI/uFuRljRoF7tbjGw2XYsnhRWRCKj3NWZlenwG4Lh5nCbL5X8jnK2REFLJ2yVD\n\tKrNytZs/fKecA/WYJWPxnSORAjrdfGvyW7aLP9oZeOcP4lxkYIiRrqvLcY+uc8vZE/\n\tiLVxPjEoQeJOr9uQhNFJJjFgxJie8K15cWcljfH8oQgG6dx2BARhUMPbJX4DzuCQX/\n\tqsDb0v+D8QYPHtVX8GvhiwVeVsssJgXQxWHnW2B2YZNh9d4zEyl0Al+znKMLkNAPgi\n\trm/0vxAhnCEzAel+Je+qz7QBduB3bSXElbFA57zR+HyWqlptM3rkBn5s5GyRNEQQmk\n\t6w408YrtgVAYg==","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=38Yvl/pHFg1W9hkWxfTar39nZsC/yR/GGyBTgoF+ELU=;\n\tb=hzSLmeCAptINCXF9zdMnqgywQrFegP5kIR0fJ3bzddbrG4wDQchNGSAGca6wuL/0zk\n\t4FZnxWsJ32if4LBF/iHHpYSE8iv//SD6u7Dsn28DtWZjtutLtEprBEpGhULv27uRyiDD\n\tXEiJQv3DzdrUpQHUF1yh8qHFRBQ6Of2xJDWoP2N7Al6NyPfr6F772zpw6D+lIbEMtYo/\n\tMSEHrLYijR65TJ28o8mcSs2VubVOtvTyUJ3orQTzJqvzZeb8gOjfy3JOvUAhAERfL+8W\n\tDAo8oD5XxVHBXDI69yI+fRvNQBhitGLv5cL597G6Be5YAYAOrOVmFtyEeRHzqKv2G9z5\n\tej3g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"hzSLmeCA\"; 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=38Yvl/pHFg1W9hkWxfTar39nZsC/yR/GGyBTgoF+ELU=;\n\tb=YTeUHhm2Qdx3pQcgALjpswzmjL/XRvqgKpYZuhHc51V6IVXjRB23HyttVyhBXSqjFd\n\tmwa0Eo2An2/53SQaD7z5qzrVflW1n3kKtGVxOuW3pZa23zGDLBG8h/k000rEFwP8kGgH\n\tiKcCKhOoHEjjU/cNX5NSWiqgDVtBAoaxAZnSwn2bZDLumRRyCGVZ/NXyfJv51lgVHdCv\n\tFcu/fh44XLz6lUAKbEtK+9Ice7jGUFIOvC+rWCz8McRYb3DtP53MG6J5BwD7t11b3/1g\n\tlClg3u1IhtMWvq9Cyr4GtJlFfHG+TejR/P8h0rdibjBcBDk6Uw5iATIzycOplxqe2ulo\n\tKg5g==","X-Gm-Message-State":"AJIora8JqufRAwBPCIP7e9o6IPaHOfEQObjAj+6V/SyrvFXWUqr4wQPR\n\tZT5dYMHvL9PRRDrEi933ScHII4JCsYM=","X-Google-Smtp-Source":"AGRyM1vyL8wfemJG+u8QRY76RaOikAmLP63AOMBAGC5htslmWtld3UEvhDNcG2BXUDOWt1P+I9Rdew==","X-Received":"by 2002:a17:90a:430a:b0:1ea:e7f4:9f59 with SMTP id\n\tq10-20020a17090a430a00b001eae7f49f59mr3704238pjg.75.1655903853067; \n\tWed, 22 Jun 2022 06:17:33 -0700 (PDT)","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 22 Jun 2022 21:16:38 +0800","Message-Id":"<20220622131638.79122-4-utkarsh02t@gmail.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20220622131638.79122-1-utkarsh02t@gmail.com>","References":"<20220622131638.79122-1-utkarsh02t@gmail.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 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\nSigned-off-by: Utkarsh Tiwari <utkarsh02t@gmail.com>\n---\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 29da3947..17cc3185 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -151,6 +151,16 @@ 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+\t}\n+\n \tstartStopAction_->setChecked(true);\n }\n \ndiff --git a/src/qcam/main_window.h b/src/qcam/main_window.h\nindex 58df4e15..1b4a4fd6 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","v2","3/3"]}