Show a patch.

GET /api/1.1/patches/18215/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 18215,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18215/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18215/",
    "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": "<20230127154322.29019-16-naush@raspberrypi.com>",
    "date": "2023-01-27T15:43:22",
    "name": "[libcamera-devel,v6,15/15] libcamera: apps: lcc: Add stream hints test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2a5641b7ccfa8b9fd74a6dc3d939e6cfd49eda82",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18215/mbox/",
    "series": [
        {
            "id": 3728,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3728/?format=api",
            "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/18215/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18215/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 E5B80C3242\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 9AEA862612;\n\tFri, 27 Jan 2023 16:43:53 +0100 (CET)",
            "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 80E36625E8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 16:43:45 +0100 (CET)",
            "by mail-wm1-x329.google.com with SMTP id\n\tf19-20020a1c6a13000000b003db0ef4dedcso5681788wmc.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.44\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Jan 2023 07:43:44 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674834233;\n\tbh=LUAtUnrEzmwGTWKwtNC+GNZf02WnRv8bO7rk/b6Yt0Y=;\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=XGiHL5GRqbZFGr5agKmCrObAtXmIuXeR0JSlZX6vsEKaGT0m2vLwT43zocNQynEwM\n\toKWiGNTDfFh3LZW6nWGbHrs2UrzEDP4NNjNdsyr1eYTemSsyvH9ID769QIjFIzea82\n\tgSyJbXocz91V/XxzT0lNYCxhXMqPwpWvW8ZBxCnD/HYVpjdwwIPBwQhiF3Uy0Ph6rE\n\tzgRmMVYIV2zL/s4xY5eZOSEkTAwvnl8UPzzOKtSETKfUT9PZbHEyzXchT0mqVsVTkG\n\tSKVzqiGxEtH8rJabH1bSTOsE9t6b904PdE2w0QAvzs6cP2l45v+wlBkSblifGwiRI5\n\tTbNMhfxYW5I5A==",
            "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=2scObb81b/oIwD4q0wu6Jc8r9Izoe6TDhaQrbOzkfu8=;\n\tb=UrRL6IyrVsoQzDnEIjQMdcflk5yemW4cHLz0L1ccej3jbBW3kOfzsVDAZ5J8wAm2tz\n\tYppcFEbwg9+MFptqJVLeEjbfIP7/lX2SHyljeIoHN3oyTr9hfX/FRJmEj51elw0/EtMW\n\tTdc44lB2TITgGDxhFhY/YVAw+CMySeMhk9eZQpvFhMA/ksVWQ+ijY6qH5fGydZ8i97b3\n\tuhR2Lsy5eZ7x/e9n4H2lY3/DcmIkIHpo99mZ18CHdcusN7CzHv9Ln1JZYOkWLdac1pna\n\tVbsGv14YbK469YzYjHTiz2MNXpmjDMKveoDdC/5RfxnxqsLW1pUFayX9x+hhSZw/RtDr\n\tfStw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"UrRL6Iyr\"; 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=2scObb81b/oIwD4q0wu6Jc8r9Izoe6TDhaQrbOzkfu8=;\n\tb=xTg9LkEc5LZrkJCVKmoMe93I+lMZCegq6DEz2Nfb7WOQMry6U53mpRcIrdRSX5pjYc\n\tC+Mhn6Wqhy80Brt2BnuZhWs7LW5OAPmjDR7QywDuOQ0f82vp+vqbzLOIH9rFDnFNfVCv\n\tN0BUJi9xt/k4CJSMCCaLkBtVCeCXzruqwB2a+Q9gvVMpKADH96Py/oGmdHNb5/yBfySr\n\tgAHTeB0EDWTlA3JjJvSVpKw52UC1+Tz2Fjqn5deAfU6GfdqYAdJaaRywVcocn5UxKXxG\n\tNxBOm/3l059B8Uoz4Lqq2I1CbfaWgoQ/uAti8GUZY83b+VQYyCqdWSsSuN95YUDQhG00\n\tHMmQ==",
        "X-Gm-Message-State": "AFqh2kpWslU9h+6hqg9CfMsguohXZ07ltCmrkBo+HkGRiltD4XFT+hlz\n\t/S0lNCpJWpeA6na4L0FUI3HV6qds8QZCPMHCN50=",
        "X-Google-Smtp-Source": "AMrXdXvLOxvsiDqojxAw1iu/Xza5r6/KS3fJc9KEHwfHgcz3mpI90OMwL1s0iUUIROimDI/08XjXvw==",
        "X-Received": "by 2002:a05:600c:540d:b0:3d9:fb59:c16b with SMTP id\n\the13-20020a05600c540d00b003d9fb59c16bmr37122954wmb.36.1674834224748; \n\tFri, 27 Jan 2023 07:43:44 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 27 Jan 2023 15:43:22 +0000",
        "Message-Id": "<20230127154322.29019-16-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 15/15] libcamera: apps: lcc: Add stream\n\thints test",
        "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, MultiCaptureHints. This tests the MandatoryStream\nhint flag and ensures that requests are cancelled correctly if the flag\nis set and no buffer is provided.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/apps/lc-compliance/capture_test.cpp  | 21 +++++++++++\n src/apps/lc-compliance/multi_capture.cpp | 48 ++++++++++++++++++++++++\n src/apps/lc-compliance/multi_capture.h   | 17 +++++++++\n 3 files changed, 86 insertions(+)",
    "diff": "diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\nindex c6a09a63248a..9239e8b5fc8a 100644\n--- a/src/apps/lc-compliance/capture_test.cpp\n+++ b/src/apps/lc-compliance/capture_test.cpp\n@@ -229,6 +229,27 @@ TEST_P(MultiStream, CaptureOptional)\n \tcapture.capture(numRequests, NumStreams, 1);\n }\n \n+/*\n+ * Test mandatory stream hints\n+ *\n+ * Mark a single stream as mandatory, and don't provide a buffer for it in the\n+ * request. This should case the queueRequest call to fail.\n+ */\n+TEST_P(MultiStream, CaptureHints)\n+{\n+\tconstexpr unsigned int NumStreams = 2;\n+\n+\tauto [roles, numRequests] = GetParam();\n+\n+\tMultiCaptureHints capture0(camera_, 0);\n+\tcapture0.configure({ roles.first, roles.second });\n+\tcapture0.capture(NumStreams);\n+\n+\tMultiCaptureHints capture1(camera_, 1);\n+\tcapture1.configure({ roles.first, roles.second });\n+\tcapture1.capture(NumStreams);\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 a011dfb285c8..6aa39b7e281f 100644\n--- a/src/apps/lc-compliance/multi_capture.cpp\n+++ b/src/apps/lc-compliance/multi_capture.cpp\n@@ -238,3 +238,51 @@ void MultiCaptureOptional::capture(unsigned int numRequests, unsigned int numStr\n \n \tASSERT_EQ(captureCount_, captureLimit_);\n }\n+\n+/* MultiCaptureHints */\n+\n+MultiCaptureHints::MultiCaptureHints(std::shared_ptr<Camera> camera,\n+\t\t\t\t     unsigned int mandatoryStream)\n+\t: MultiCaptureBase(camera), mandatoryStream_(mandatoryStream)\n+{\n+}\n+\n+void MultiCaptureHints::capture(unsigned int numStreams)\n+{\n+\tstart();\n+\n+\tstd::vector<const FrameBufferList *>\n+\t\tbuffers = prepareBuffers(config_->at(0).bufferCount, numStreams);\n+\n+\tif (!buffers.size())\n+\t\tGTEST_SKIP();\n+\n+\t/* Queue a single request */\n+\tstd::unique_ptr<Request> request = camera_->createRequest();\n+\tASSERT_TRUE(request) << \"Can't create request\";\n+\n+\tfor (unsigned int j = 0; j < numStreams; j++) {\n+\t\tconst FrameBufferList *bufferList = buffers[j];\n+\t\tStream *stream = config_->at(j).stream();\n+\n+\t\t/*\n+\t\t * Do not add a buffer for the mandatory stream to cause a\n+\t\t * deliberate failure.\n+\t\t */\n+\t\tif (j == mandatoryStream_)\n+\t\t\tcontinue;\n+\n+\t\tASSERT_EQ(request->addBuffer(stream, (*bufferList)[0].get()), 0)\n+\t\t\t<< \"Can't set buffer for request\";\n+\t}\n+\n+\tASSERT_EQ(camera_->queueRequest(request.get()), -ENOMEM)\n+\t\t<< \"queueRequest did not fail!\";\n+\n+\tstop();\n+}\n+\n+void MultiCaptureHints::updateConfig()\n+{\n+\tconfig_.get()->at(mandatoryStream_).hints = StreamConfiguration::Hint::MandatoryStream;\n+}\ndiff --git a/src/apps/lc-compliance/multi_capture.h b/src/apps/lc-compliance/multi_capture.h\nindex 3d92ba3d4c10..c48c16e7565d 100644\n--- a/src/apps/lc-compliance/multi_capture.h\n+++ b/src/apps/lc-compliance/multi_capture.h\n@@ -68,3 +68,20 @@ public:\n \tvoid capture(unsigned int numRequests, unsigned int numStreams,\n \t\t     unsigned int optionalStream);\n };\n+\n+class MultiCaptureHints : public MultiCaptureBase\n+{\n+public:\n+\tMultiCaptureHints(std::shared_ptr<libcamera::Camera> camera,\n+\t\t\t  unsigned int mandatoryStream);\n+\n+\tvoid capture(unsigned int numStreams);\n+\n+private:\n+\tvoid updateConfig() override;\n+\tvoid requestComplete([[maybe_unused]] libcamera::Request *request) override\n+\t{\n+\t}\n+\n+\tunsigned int mandatoryStream_;\n+};\n",
    "prefixes": [
        "libcamera-devel",
        "v6",
        "15/15"
    ]
}