Patch Detail
Show a patch.
GET /api/patches/19358/?format=api
{ "id": 19358, "url": "https://patchwork.libcamera.org/api/patches/19358/?format=api", "web_url": "https://patchwork.libcamera.org/patch/19358/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20231230162912.827669-8-jacopo.mondi@ideasonboard.com>", "date": "2023-12-30T16:29:12", "name": "[libcamera-devel,v3,7/7] apps: lc-compliance: Add multi-stream tests", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "cb24052da45fab43bc5ed2a5b668cf713d108922", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/19358/mbox/", "series": [ { "id": 4129, "url": "https://patchwork.libcamera.org/api/series/4129/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4129", "date": "2023-12-30T16:29:05", "name": "apps: lc-compliance: Properties and multi-stream tests", "version": 3, "mbox": "https://patchwork.libcamera.org/series/4129/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/19358/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/19358/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 BCB61C32BE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 30 Dec 2023 16:29:40 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6759962B6E;\n\tSat, 30 Dec 2023 17:29:40 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9517362B5A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Dec 2023 17:29:34 +0100 (CET)", "from localhost.localdomain (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 37CFE8BE;\n\tSat, 30 Dec 2023 17:28:37 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1703953780;\n\tbh=0qXTzc+FXDdLo6Zf6MEwfvpOHyPH64OjZgdVDuKTecs=;\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:Cc:\n\tFrom;\n\tb=gCVgzHV2Fz6qohjPcAWqsC5kP3C9IGPvARMcaARybo5xGKplguoUsd2c6D1HznRP1\n\tBlj7U/1avptBj7Z+OrU0wJp2qX00wkKeVHtEfSe1tQlva8gnEJ2Va0XxvIJumx9VAQ\n\tZ4jdvWC4Dto5QWU4QSobbwijcYKuZAkJltmIGnZaQDR9D6Qb0IV9THExQCR/XawxhG\n\tBL93gcQVM9Il5wKd2jhvKHbNhsz1tm9A7SN+rw/wWuANuxKlCxKt24gnXXi5+kNXX6\n\t4QXWA3KZkr+ByMnkLfHi8X8R2I5nMsfoVwAuuQprrFyLyN2oo/4NFe8UWh7kfLyARP\n\t4mEyuAcC13dtQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1703953717;\n\tbh=0qXTzc+FXDdLo6Zf6MEwfvpOHyPH64OjZgdVDuKTecs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bS6Tv8pEq3/a6QF1htJQBWHtKftnsVULPQkWiegT49129V0aShkdXpQa/uvCGIXqo\n\tJs4Dh7Grc24Dt6PYkhN4nwulf9vDL0yWsCxZqKx8fdTAtgXvxdyP6T0hZIjBdee5w1\n\t0gnNEJCWS8GYQb7C0JL4hGdN2g7krcbBYfaHOxjE=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"bS6Tv8pE\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Sat, 30 Dec 2023 17:29:12 +0100", "Message-ID": "<20231230162912.827669-8-jacopo.mondi@ideasonboard.com>", "X-Mailer": "git-send-email 2.41.0", "In-Reply-To": "<20231230162912.827669-1-jacopo.mondi@ideasonboard.com>", "References": "<20231230162912.827669-1-jacopo.mondi@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 7/7] apps: lc-compliance: Add\n\tmulti-stream tests", "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": "Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add a test suite for testing capture operations with multiple\nstreams.\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\n src/apps/lc-compliance/tests/capture_test.cpp | 92 +++++++++++++++++--\n 1 file changed, 85 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/apps/lc-compliance/tests/capture_test.cpp b/src/apps/lc-compliance/tests/capture_test.cpp\nindex 3d3cc97791d9..3f4a2f71d10b 100644\n--- a/src/apps/lc-compliance/tests/capture_test.cpp\n+++ b/src/apps/lc-compliance/tests/capture_test.cpp\n@@ -16,6 +16,8 @@\n \n using namespace libcamera;\n \n+namespace {\n+\n const std::vector<int> NUMREQUESTS = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n const std::vector<std::vector<StreamRole>> ROLES = {\n \t{ StreamRole::Raw },\n@@ -24,6 +26,22 @@ const std::vector<std::vector<StreamRole>> ROLES = {\n \t{ StreamRole::Viewfinder },\n };\n \n+const std::vector<std::array<StreamRole, 2>> 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+std::map<StreamRole, std::string> rolesMap = {\n+\t{ StreamRole::Raw, \"Raw\" },\n+\t{ StreamRole::StillCapture, \"StillCapture\" },\n+\t{ StreamRole::VideoRecording, \"VideoRecording\" },\n+\t{ StreamRole::Viewfinder, \"Viewfinder\" }\n+};\n+\n+} /* namespace */\n+\n class SingleStream : public testing::TestWithParam<std::tuple<std::vector<StreamRole>, int>>\n {\n public:\n@@ -60,13 +78,6 @@ void SingleStream::TearDown()\n \n std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::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-\n \tstd::string roleName = rolesMap[std::get<0>(info.param)[0]];\n \tstd::string numRequestsName = std::to_string(std::get<1>(info.param));\n \n@@ -134,3 +145,70 @@ INSTANTIATE_TEST_SUITE_P(CaptureTests,\n \t\t\t testing::Combine(testing::ValuesIn(ROLES),\n \t\t\t\t\t testing::ValuesIn(NUMREQUESTS)),\n \t\t\t SingleStream::nameParameters);\n+\n+class MultiStream : public testing::TestWithParam<std::tuple<std::array<StreamRole, 2>, int>>\n+{\n+public:\n+\tstatic std::string nameParameters(const testing::TestParamInfo<MultiStream::ParamType> &info);\n+\n+protected:\n+\tvoid SetUp() override;\n+\tvoid TearDown() override;\n+\n+\tstd::shared_ptr<Camera> camera_;\n+};\n+\n+/*\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 MultiStream::SetUp()\n+{\n+\tEnvironment *env = Environment::get();\n+\n+\tcamera_ = env->cm()->get(env->cameraId());\n+\n+\tASSERT_EQ(camera_->acquire(), 0);\n+}\n+\n+void MultiStream::TearDown()\n+{\n+\tif (!camera_)\n+\t\treturn;\n+\n+\tcamera_->release();\n+\tcamera_.reset();\n+}\n+\n+std::string MultiStream::nameParameters(const testing::TestParamInfo<MultiStream::ParamType> &info)\n+{\n+\tstd::string roleName = rolesMap[std::get<0>(info.param)[0]] + \"_\" +\n+\t\t\t rolesMap[std::get<0>(info.param)[1]];\n+\tstd::string numRequestsName = std::to_string(std::get<1>(info.param));\n+\n+\treturn roleName + \"_\" + numRequestsName;\n+}\n+\n+/*\n+ * Test multi-stream capture cycles\n+ *\n+ * Makes sure the camera completes the exact number of requests queued. Example\n+ * failure is a camera that completes less requests than the number of requests\n+ * queued.\n+ */\n+TEST_P(MultiStream, Capture)\n+{\n+\tconst auto [roles, numRequests] = GetParam();\n+\n+\tCaptureBalanced capture(camera_);\n+\n+\tcapture.configure(Span<const StreamRole>{ roles });\n+\n+\tcapture.capture(numRequests);\n+}\n+\n+INSTANTIATE_TEST_SUITE_P(MultiCaptureTests,\n+\t\t\t MultiStream,\n+\t\t\t testing::Combine(testing::ValuesIn(MULTIROLES),\n+\t\t\t\t\t testing::ValuesIn(NUMREQUESTS)),\n+\t\t\t MultiStream::nameParameters);\n", "prefixes": [ "libcamera-devel", "v3", "7/7" ] }