[{"id":17114,"web_url":"https://patchwork.libcamera.org/comment/17114/","msgid":"<YKjV2gjAcCqaEWKf@oden.dyn.berto.se>","date":"2021-05-22T09:58:50","subject":"Re: [libcamera-devel] [PATCH v2] lc-compliance: Add test to call\n\tmultiple configure()","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Nícolas,\n\nThanks for your work.\n\nOn 2021-05-18 15:46:01 -0300, Nícolas F. R. A. Prado wrote:\n> Add a test to lc-compliance that calls configure() multiple times on the\n> camera before starting to capture. This isn't a common pattern for\n> applications but is allowed and so should be tested by lc-compliance.\n> \n> Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n> ---\n> Changes in v2:\n> - Thanks to Niklas:\n>   - Move roles vector inside the configure test\n> \n>  src/lc-compliance/single_stream.cpp | 32 ++++++++++++++++++++++++++++-\n>  1 file changed, 31 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/lc-compliance/single_stream.cpp b/src/lc-compliance/single_stream.cpp\n> index 8318b42f42d6..9159ea17fcf2 100644\n> --- a/src/lc-compliance/single_stream.cpp\n> +++ b/src/lc-compliance/single_stream.cpp\n> @@ -33,6 +33,26 @@ Results::Result testRequestBalance(std::shared_ptr<Camera> camera,\n>  \t\tstd::to_string(startCycles) + \" start cycles\" };\n>  }\n>  \n> +Results::Result testMultipleConfigures(std::shared_ptr<Camera> camera,\n> +\t\t\t\t       StreamRole role, unsigned int numRequests)\n> +{\n> +\tconst std::vector<StreamRole> roles = { Raw, StillCapture, VideoRecording, Viewfinder };\n> +\tResults::Result ret;\n> +\n> +\tSimpleCaptureBalanced capture(camera);\n> +\n> +\tfor (auto r: roles) {\n> +\t\tret = capture.configure(r);\n> +\t\tif (ret.first == Results::Fail)\n> +\t\t\treturn ret;\n> +\t}\n\nWith an added new line here,\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> +\tret = capture.configure(role);\n> +\tif (ret.first != Results::Pass)\n> +\t\treturn ret;\n> +\n> +\treturn capture.capture(numRequests);\n> +}\n> +\n>  Results::Result testRequestUnbalance(std::shared_ptr<Camera> camera,\n>  \t\t\t\t     StreamRole role, unsigned int numRequests)\n>  {\n> @@ -55,7 +75,7 @@ Results testSingleStream(std::shared_ptr<Camera> camera)\n>  \t};\n>  \tstatic const std::vector<unsigned int> numRequests = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n>  \n> -\tResults results(numRequests.size() * roles.size() * 3);\n> +\tResults results(numRequests.size() * roles.size() * 3 + roles.size());\n>  \n>  \tfor (const auto &role : roles) {\n>  \t\tstd::cout << \"= Test role \" << role.first << std::endl;\n> @@ -91,6 +111,16 @@ Results testSingleStream(std::shared_ptr<Camera> camera)\n>  \t\tstd::cout << \"* Test unbalanced stop\" << std::endl;\n>  \t\tfor (unsigned int num : numRequests)\n>  \t\t\tresults.add(testRequestUnbalance(camera, role.second, num));\n> +\n> +\t\t/*\n> +\t\t * Test multiple configure()\n> +\t\t *\n> +\t\t * Makes sure that the camera supports being configured multiple\n> +\t\t * times, with only the last one taking effect, before starting\n> +\t\t * to capture.\n> +\t\t */\n> +\t\tstd::cout << \"* Test multiple configure()\" << std::endl;\n> +\t\tresults.add(testMultipleConfigures(camera, role.second, numRequests.back()));\n>  \t}\n>  \n>  \treturn results;\n> -- \n> 2.31.1\n>","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 9F088C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 22 May 2021 09:58:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EF2EA6891F;\n\tSat, 22 May 2021 11:58:53 +0200 (CEST)","from mail-lj1-x235.google.com (mail-lj1-x235.google.com\n\t[IPv6:2a00:1450:4864:20::235])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1919B602B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 22 May 2021 11:58:52 +0200 (CEST)","by mail-lj1-x235.google.com with SMTP id w7so13533359lji.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 22 May 2021 02:58:52 -0700 (PDT)","from localhost (h-155-4-209-203.A463.priv.bahnhof.se.\n\t[155.4.209.203]) by smtp.gmail.com with ESMTPSA id\n\tq19sm876887lff.214.2021.05.22.02.58.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 22 May 2021 02:58:51 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com\n\theader.b=\"q0tCnnsl\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=Ijx9buIk+0I+abXM+aqQRK3uLf3hXtlV/A35aTJrK6A=;\n\tb=q0tCnnslXV4U+hUCw2dneGgB9rk9bg0i4oZTiTCg2XI9AhZjq7gx4/dXsVbTGCd3JJ\n\ty4Mssz+9uvdew+kbMyJG1iZ/XXiQQ23lBj12IgyKYufVDtjrTCtBGGyMmjLQ4BjGjhmu\n\tiPjBK7aF6y1R2cWHB9PvP6ou2RiiLjmbrD39dqwZwFb+in7RnDQqf4isTEewl79njkM1\n\tn6QNY5PqRNbd7+HSWVP+WgB19SP6UnsXjVBZlour60QAc0Lw30lGpxZ4JqbzG3la67YW\n\t9oIHHMYfqMuVZgNjAlbdVwk0pJYlJKd/fG/UslhK6R4L/R0jDnB7T3gEhyE6XApIQW0O\n\tSJ+w==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=Ijx9buIk+0I+abXM+aqQRK3uLf3hXtlV/A35aTJrK6A=;\n\tb=qh7v+9lrdol2UoMg02Aj/p5OBXeltJDmw/APZydoRSmeR/wJTm+dzEhmiRGCrJ2Voi\n\t2vxwgxhPWxfA6zebNQt/PGSp2qv9CQxYZ9wBMgj4Pq5e2ybDQxVfbKYR0sAUzPusyJ91\n\t+xpWEudwibQd70bSbPM5FDYAfj1ziXBluWzitdkrx2dko+EOt/bZQXMjac/DMmVIRi1E\n\t2d+adjrP3TptMUt6j55RC/ogeslDyVIBQL1JD/2PHAV368q1YS3vgjRgsu7ix9V0HChe\n\tgSEceTdTMKgqYMBltFNlZxsO0xdiWdkc0RBxjHEfanGm58FM8Ji5mB7FXlc8ET7saaYg\n\tZFTw==","X-Gm-Message-State":"AOAM5331ALjeSWDWOkOS9lb9TlwrzBJ3eSiu5LjxCJBgiUi7Fs0H+AkJ\n\tfeWoiODRS8+gReK9Zeb590f7B4Md5E0YUw==","X-Google-Smtp-Source":"ABdhPJy2fUUUCySDWc36Sp+M1SH2WJ7RlfZC0kXCuxw0G9rBkGsv8eX6eP3nHcDbgrBqNMq/tBJSvA==","X-Received":"by 2002:a2e:9802:: with SMTP id a2mr9798936ljj.232.1621677531526;\n\tSat, 22 May 2021 02:58:51 -0700 (PDT)","Date":"Sat, 22 May 2021 11:58:50 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"=?iso-8859-1?q?N=EDcolas_F=2E_R=2E_A=2E?= Prado <nfraprado@collabora.com>","Message-ID":"<YKjV2gjAcCqaEWKf@oden.dyn.berto.se>","References":"<20210518184601.65483-1-nfraprado@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20210518184601.65483-1-nfraprado@collabora.com>","Subject":"Re: [libcamera-devel] [PATCH v2] lc-compliance: Add test to call\n\tmultiple configure()","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>","Cc":"libcamera-devel@lists.libcamera.org, kernel@collabora.com,\n\t=?iso-8859-1?q?Andr=E9?= Almeida <andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]