Patch Detail
Show a patch.
GET /api/1.1/patches/22438/?format=api
{ "id": 22438, "url": "https://patchwork.libcamera.org/api/1.1/patches/22438/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22438/", "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": "<20241220150759.709756-13-pobrn@protonmail.com>", "date": "2024-12-20T15:08:58", "name": "[RFC,v1,12/12] apps: lc-compliance: Add multi-stream tests", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "088f215f10f68b1f9949cbb568de3114e9b49b94", "submitter": { "id": 133, "url": "https://patchwork.libcamera.org/api/1.1/people/133/?format=api", "name": "Pőcze Barnabás", "email": "pobrn@protonmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22438/mbox/", "series": [ { "id": 4923, "url": "https://patchwork.libcamera.org/api/1.1/series/4923/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4923", "date": "2024-12-20T15:08:03", "name": "apps: lc-compliance: Multi-stream tests", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4923/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22438/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22438/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 29500C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 15:09:06 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B0B22684B2;\n\tFri, 20 Dec 2024 16:09:05 +0100 (CET)", "from mail-4316.protonmail.ch (mail-4316.protonmail.ch\n\t[185.70.43.16])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0B5A6684AE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 16:09:03 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"hbsiWWvE\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1734707342; x=1734966542;\n\tbh=jvEfDcpVLMS3dZmFCxIdo0hoK5ndJ3c1uZ7U7Bgzg5I=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=hbsiWWvEMRzWnKIbyqQ7oqcrLo7jMdKqYzmgctJlbbXZSNr5TbM88GOSO1Ktubp2P\n\tUMusOVM2lsUymCyfjvz2PPbitZUrux5nEk6kam/GRzV2PUid9QxFyvO7VtNLuYfHhT\n\tChTLEYARxYz2wSiIteZjQrYPS2J6HPlzptfhwXNoIWP94U0JvxUgmRMpwlEZEJrSjf\n\tiHYHVHF/MDt+T55NCGrN8Xn6MHptTkSqwmUz6Lkzz0fA9X4DfgWjQrYO7nzLn4KVEl\n\tYSBkzOA3YaQK5gNFgSLjoS8eqwjTcKRSXjessNVWG1DOptm1IKaETmByindbKUwkOy\n\tt7dQ8a+1BpoTA==", "Date": "Fri, 20 Dec 2024 15:08:58 +0000", "To": "libcamera-devel@lists.libcamera.org", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Subject": "[RFC PATCH v1 12/12] apps: lc-compliance: Add multi-stream tests", "Message-ID": "<20241220150759.709756-13-pobrn@protonmail.com>", "In-Reply-To": "<20241220150759.709756-1-pobrn@protonmail.com>", "References": "<20241220150759.709756-1-pobrn@protonmail.com>", "Feedback-ID": "20568564:user:proton", "X-Pm-Message-ID": "da41cd29e5586f7d8ffef82a1be3c6857f4815e1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=utf-8", "Content-Transfer-Encoding": "quoted-printable", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Rename the `SingleStream` test to `SimpleCapture`, and\nextend it to support using multiple roles. And instantiate\nanother test suite from the `SimpleCapture` test that\ntests multiple streams in one capture session.\n\nCo-developed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n---\n src/apps/lc-compliance/tests/capture_test.cpp | 85 +++++++++++--------\n 1 file changed, 48 insertions(+), 37 deletions(-)", "diff": "diff --git a/src/apps/lc-compliance/tests/capture_test.cpp b/src/apps/lc-compliance/tests/capture_test.cpp\nindex c382fcf47..8ea422f0d 100644\n--- a/src/apps/lc-compliance/tests/capture_test.cpp\n+++ b/src/apps/lc-compliance/tests/capture_test.cpp\n@@ -8,7 +8,7 @@\n \n #include \"capture.h\"\n \n-#include <iostream>\n+#include <sstream>\n \n #include <gtest/gtest.h>\n \n@@ -18,19 +18,10 @@ namespace {\n \n using namespace libcamera;\n \n-const int NUMREQUESTS[] = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n-\n-const StreamRole ROLES[] = {\n-\tStreamRole::Raw,\n-\tStreamRole::StillCapture,\n-\tStreamRole::VideoRecording,\n-\tStreamRole::Viewfinder\n-};\n-\n-class SingleStream : public testing::TestWithParam<std::tuple<StreamRole, int>>\n+class SimpleCapture : public testing::TestWithParam<std::tuple<std::vector<StreamRole>, int>>\n {\n public:\n-\tstatic std::string nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info);\n+\tstatic std::string nameParameters(const testing::TestParamInfo<SimpleCapture::ParamType> &info);\n \n protected:\n \tvoid SetUp() override;\n@@ -43,7 +34,7 @@ protected:\n * We use gtest's SetUp() and TearDown() instead of constructor and destructor\n * in order to be able to assert on them.\n */\n-void SingleStream::SetUp()\n+void SimpleCapture::SetUp()\n {\n \tEnvironment *env = Environment::get();\n \n@@ -52,7 +43,7 @@ void SingleStream::SetUp()\n \tASSERT_EQ(camera_->acquire(), 0);\n }\n \n-void SingleStream::TearDown()\n+void SimpleCapture::TearDown()\n {\n \tif (!camera_)\n \t\treturn;\n@@ -61,19 +52,17 @@ void SingleStream::TearDown()\n \tcamera_.reset();\n }\n \n-std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n+std::string SimpleCapture::nameParameters(const testing::TestParamInfo<SimpleCapture::ParamType> &info)\n {\n-\tstd::map<StreamRole, std::string> rolesMap = {\n-\t\t{ StreamRole::Raw, \"Raw\" },\n-\t\t{ StreamRole::StillCapture, \"StillCapture\" },\n-\t\t{ StreamRole::VideoRecording, \"VideoRecording\" },\n-\t\t{ StreamRole::Viewfinder, \"Viewfinder\" }\n-\t};\n+\tconst auto &[roles, numRequests] = info.param;\n+\tstd::ostringstream ss;\n \n-\tstd::string roleName = rolesMap[std::get<0>(info.param)];\n-\tstd::string numRequestsName = std::to_string(std::get<1>(info.param));\n+\tfor (StreamRole r : roles)\n+\t\tss << r << '_';\n \n-\treturn roleName + \"_\" + numRequestsName;\n+\tss << '_' << numRequests;\n+\n+\treturn std::move(ss).str();\n }\n \n /*\n@@ -83,13 +72,13 @@ std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStre\n * failure is a camera that completes less requests than the number of requests\n * queued.\n */\n-TEST_P(SingleStream, Capture)\n+TEST_P(SimpleCapture, Capture)\n {\n-\tauto [role, numRequests] = GetParam();\n+\tconst auto &[roles, numRequests] = GetParam();\n \n \tCaptureBalanced capture(camera_);\n \n-\tcapture.configure(std::array{ role });\n+\tcapture.configure(roles);\n \n \tcapture.capture(numRequests);\n }\n@@ -101,14 +90,14 @@ TEST_P(SingleStream, Capture)\n * a camera that does not clean up correctly in its error path but is only\n * tested by single-capture applications.\n */\n-TEST_P(SingleStream, CaptureStartStop)\n+TEST_P(SimpleCapture, CaptureStartStop)\n {\n-\tauto [role, numRequests] = GetParam();\n+\tconst auto &[roles, numRequests] = GetParam();\n \tunsigned int numRepeats = 3;\n \n \tCaptureBalanced capture(camera_);\n \n-\tcapture.configure(std::array{ role });\n+\tcapture.configure(roles);\n \n \tfor (unsigned int starts = 0; starts < numRepeats; starts++)\n \t\tcapture.capture(numRequests);\n@@ -121,21 +110,43 @@ TEST_P(SingleStream, CaptureStartStop)\n * is a camera that does not handle cancelation of buffers coming back from the\n * video device while stopping.\n */\n-TEST_P(SingleStream, UnbalancedStop)\n+TEST_P(SimpleCapture, UnbalancedStop)\n {\n-\tauto [role, numRequests] = GetParam();\n+\tconst auto &[roles, numRequests] = GetParam();\n \n \tCaptureUnbalanced capture(camera_);\n \n-\tcapture.configure(std::array{ role });\n+\tcapture.configure(roles);\n \n \tcapture.capture(numRequests);\n }\n \n-INSTANTIATE_TEST_SUITE_P(CaptureTests,\n-\t\t\t SingleStream,\n-\t\t\t testing::Combine(testing::ValuesIn(ROLES),\n+const int NUMREQUESTS[] = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n+\n+const std::vector<StreamRole> SINGLEROLES[] = {\n+\t{ StreamRole::Raw, },\n+\t{ StreamRole::StillCapture, },\n+\t{ StreamRole::VideoRecording, },\n+\t{ StreamRole::Viewfinder, },\n+};\n+\n+const std::vector<StreamRole> MULTIROLES[] = {\n+\t{ StreamRole::Raw, StreamRole::StillCapture },\n+\t{ StreamRole::Raw, StreamRole::VideoRecording },\n+\t{ StreamRole::StillCapture, StreamRole::VideoRecording },\n+\t{ StreamRole::VideoRecording, StreamRole::VideoRecording },\n+};\n+\n+INSTANTIATE_TEST_SUITE_P(SingleStream,\n+\t\t\t SimpleCapture,\n+\t\t\t testing::Combine(testing::ValuesIn(SINGLEROLES),\n+\t\t\t\t\t testing::ValuesIn(NUMREQUESTS)),\n+\t\t\t SimpleCapture::nameParameters);\n+\n+INSTANTIATE_TEST_SUITE_P(MultiStream,\n+\t\t\t SimpleCapture,\n+\t\t\t testing::Combine(testing::ValuesIn(MULTIROLES),\n \t\t\t\t\t testing::ValuesIn(NUMREQUESTS)),\n-\t\t\t SingleStream::nameParameters);\n+\t\t\t SimpleCapture::nameParameters);\n \n } /* namespace */\n", "prefixes": [ "RFC", "v1", "12/12" ] }