{"id":18214,"url":"https://patchwork.libcamera.org/api/1.1/patches/18214/?format=json","web_url":"https://patchwork.libcamera.org/patch/18214/","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":"<20230127154322.29019-15-naush@raspberrypi.com>","date":"2023-01-27T15:43:21","name":"[libcamera-devel,v6,14/15] libcamera: apps: lcc: Add optional stream tests","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"ca32f2673af82cb2427215cfa1e8b364e7d567e3","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18214/mbox/","series":[{"id":3728,"url":"https://patchwork.libcamera.org/api/1.1/series/3728/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3728","date":"2023-01-27T15:43:07","name":"[libcamera-devel,v6,01/15] libcamera: stream: Add stream hints to StreamConfiguration","version":6,"mbox":"https://patchwork.libcamera.org/series/3728/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18214/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18214/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 62B07C3299\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jan 2023 15:43:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0E0BB6260E;\n\tFri, 27 Jan 2023 16:43:53 +0100 (CET)","from mail-wm1-x336.google.com (mail-wm1-x336.google.com\n\t[IPv6:2a00:1450:4864:20::336])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6071062605\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 16:43:45 +0100 (CET)","by mail-wm1-x336.google.com with SMTP id m15so3740760wms.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 07:43:45 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Jan 2023 07:43:43 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674834233;\n\tbh=CR3beotvVv+IR6MJ9i1aC77DfZeOx13xFujkR6NZtX0=;\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=qNvptr7aMm7njT9sis0aTqnwq4xLcwn1XOseMehFq7n34LWffiF45EOsYHjGM4SYp\n\t7RpFg0f7mznj4V469cgcAG+hHos83NPp27RQEHi1G8DUM0GZcI72yclAKCkAPl9F2T\n\ty1VeAKfyyPTXMW/lWC1WdJqMXJ8wy+W6gHXW+r7OhnszBG141oN0g2HCRdcMq7XYhL\n\tMBTVDCeY/8TyfCSw5yZvU8G7+vgqVGfU0OKAQc3IhZmGZ60PM6IbXSgooQ7lrr0/s7\n\twlRtC2GtnBV5VTQOYoSFaYZUxy7+S5CsnE6Cm4JqY3kGNDK24D7GTMWyju6+3GuR7A\n\t764Ext8fxj/1A==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=/hgBGNe9687TY2y9ydcpdr81a5GOgRL+7LnWjqWMLcw=;\n\tb=p2zS6brGgO0J/UmSHc2dR+MNF+GeU9QdHCaTDmS5Mn9kaBiXnwch2+Vck13Rv6c8zq\n\ttCrPD5585wXllHLOPfDU47DefGwRGKJr6fJMTXuEOGkV6WFXxUsyiJSqWACZ28ZEEneM\n\t4TDDx0Y+UbXhD/8ODkTCNja+oyw/+5KtF3vWEFeakQqbdR0yC/lAu8fPgTqe0A3L9qmW\n\tHl0o90FSe7ZW/Dg5DR0PIk0I/+z3zgSQ8zv1Qd3bCQ3/OsYk+bWzxUbok5ShsuqEIzIF\n\t0SLxcuIdHhPRRqTObzBO8nyaiRah1bHFgMX7OElHfLFy/uPOWf7pAp1g/OaAXHYOrvKn\n\ttfDQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"p2zS6brG\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=/hgBGNe9687TY2y9ydcpdr81a5GOgRL+7LnWjqWMLcw=;\n\tb=QSXz9uVirnveus/vO0y7AXI6FkRU1/VDbvyRpfU9MIi+l6a/rgMsykzLfNdnv6rPu/\n\tkAWIbgq99GTt9uzi0boEf70Tht2t/9RaUdn7pBCw//nh0gAzwcVYjegZm5is4Vf6fUyY\n\tWjGLffER3M/n6eczLP3NcvwD0ug5YPhPBzv59M0masGIx2GD7/T2ahAEceWuxCZxrzxf\n\tgFGgC/bfRHjnvucQSwb5P/C9KswZSidxTv14W/AFSEK7iYFn9sIYqFgLvLXykmzo2k7Z\n\tQ6rO1djoe/UgCIK8idV9yv6G1N3v+cprncSke+Rc4m8OyvofIAPGCaWJ44WpMrsBMjji\n\tpVZA==","X-Gm-Message-State":"AFqh2kqxDTZX/Ne0S3AzOy+2CM0pbK/2Ex10RIY9+q/k2OMvVUIgND6O\n\tOIPgaW3sQLIf7xUb3olBzWdqL5pd8FLxVyG6ECY=","X-Google-Smtp-Source":"AMrXdXugLXhZa8lRtuRFIQsMOfkqyI1NSAsFoemJrSXhUzwQd6L8VH4a4iece2Ym0ajxguUIC9llfg==","X-Received":"by 2002:a05:600c:1e08:b0:3da:f443:9f0f with SMTP id\n\tay8-20020a05600c1e0800b003daf4439f0fmr41127887wmb.18.1674834224149; \n\tFri, 27 Jan 2023 07:43:44 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 27 Jan 2023 15:43:21 +0000","Message-Id":"<20230127154322.29019-15-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230127154322.29019-1-naush@raspberrypi.com>","References":"<20230127154322.29019-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 14/15] libcamera: apps: lcc: Add\n\toptional 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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Add a new test class, MultiCaptureOptional. This tests operating with\nmultiple streams, where one of the two streams is not provided buffers\nin certain requests.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/apps/lc-compliance/capture_test.cpp  | 20 +++++++++\n src/apps/lc-compliance/multi_capture.cpp | 53 ++++++++++++++++++++++++\n src/apps/lc-compliance/multi_capture.h   |  9 ++++\n 3 files changed, 82 insertions(+)","diff":"diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\nindex 8d534161e985..c6a09a63248a 100644\n--- a/src/apps/lc-compliance/capture_test.cpp\n+++ b/src/apps/lc-compliance/capture_test.cpp\n@@ -209,6 +209,26 @@ TEST_P(MultiStream, Capture)\n \tcapture.capture(numRequests, NumStreams);\n }\n \n+/*\n+ * Test optional stream capture cycles\n+ *\n+ * Do not provide buffers for all streams in all Requests, testing that stream\n+ * output can be optional.\n+ */\n+TEST_P(MultiStream, CaptureOptional)\n+{\n+\tconstexpr unsigned int NumStreams = 2;\n+\n+\tauto [roles, numRequests] = GetParam();\n+\n+\tMultiCaptureOptional capture(camera_);\n+\n+\tcapture.configure({ roles.first, roles.second });\n+\n+\tcapture.capture(numRequests, NumStreams, 0);\n+\tcapture.capture(numRequests, NumStreams, 1);\n+}\n+\n INSTANTIATE_TEST_SUITE_P(MultiCaptureTests,\n \t\t\t MultiStream,\n \t\t\t testing::Combine(testing::ValuesIn(MULTIROLES),\ndiff --git a/src/apps/lc-compliance/multi_capture.cpp b/src/apps/lc-compliance/multi_capture.cpp\nindex 23becf964fd7..a011dfb285c8 100644\n--- a/src/apps/lc-compliance/multi_capture.cpp\n+++ b/src/apps/lc-compliance/multi_capture.cpp\n@@ -185,3 +185,56 @@ void MultiCapture::requestComplete(Request *request)\n \tif (queueRequest(request))\n \t\tloop_->exit(-EINVAL);\n }\n+\n+/* MultiCaptureOptional */\n+\n+MultiCaptureOptional::MultiCaptureOptional(std::shared_ptr<Camera> camera)\n+\t: MultiCapture(camera)\n+{\n+}\n+\n+void MultiCaptureOptional::capture(unsigned int numRequests, unsigned int numStreams,\n+\t\t\t\t   unsigned int optionalStream)\n+{\n+\tstart();\n+\n+\tqueueCount_ = 0;\n+\tcaptureCount_ = 0;\n+\tcaptureLimit_ = numRequests;\n+\n+\tstd::vector<const FrameBufferList *>\n+\t\tbuffers = prepareBuffers(numRequests, numStreams);\n+\n+\tif (!buffers.size())\n+\t\tGTEST_SKIP();\n+\n+\t/* Queue the recommended number of requests. */\n+\tconst unsigned int inFlightRequests = config_->at(0).bufferCount;\n+\tfor (unsigned int i = 0; i < inFlightRequests; i++) {\n+\t\tstd::unique_ptr<Request> request = camera_->createRequest();\n+\t\tASSERT_TRUE(request) << \"Can't create request\";\n+\n+\t\tfor (unsigned int j = 0; j < numStreams; j++) {\n+\t\t\tconst FrameBufferList *bufferList = buffers[j];\n+\t\t\tStream *stream = config_->at(j).stream();\n+\n+\t\t\tif (j == optionalStream && !i)\n+\t\t\t\tcontinue;\n+\n+\t\t\tASSERT_EQ(request->addBuffer(stream, (*bufferList)[i].get()), 0)\n+\t\t\t\t<< \"Can't set buffer for request\";\n+\t\t}\n+\n+\t\tASSERT_EQ(queueRequest(request.get()), 0)\n+\t\t\t<< \"Failed to queue request\";\n+\t\trequests_.push_back(std::move(request));\n+\t}\n+\n+\t/* Run capture session. */\n+\tloop_ = new EventLoop();\n+\tloop_->exec();\n+\tstop();\n+\tdelete loop_;\n+\n+\tASSERT_EQ(captureCount_, captureLimit_);\n+}\ndiff --git a/src/apps/lc-compliance/multi_capture.h b/src/apps/lc-compliance/multi_capture.h\nindex 9037099988e5..3d92ba3d4c10 100644\n--- a/src/apps/lc-compliance/multi_capture.h\n+++ b/src/apps/lc-compliance/multi_capture.h\n@@ -59,3 +59,12 @@ protected:\n \tunsigned int captureCount_;\n \tunsigned int captureLimit_;\n };\n+\n+class MultiCaptureOptional : public MultiCapture\n+{\n+public:\n+\tMultiCaptureOptional(std::shared_ptr<libcamera::Camera> camera);\n+\n+\tvoid capture(unsigned int numRequests, unsigned int numStreams,\n+\t\t     unsigned int optionalStream);\n+};\n","prefixes":["libcamera-devel","v6","14/15"]}