Patch Detail
Show a patch.
GET /api/1.1/patches/23642/?format=api
{ "id": 23642, "url": "https://patchwork.libcamera.org/api/1.1/patches/23642/?format=api", "web_url": "https://patchwork.libcamera.org/patch/23642/", "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": "<20250624122830.726987-1-barnabas.pocze@ideasonboard.com>", "date": "2025-06-24T12:28:29", "name": "[RFC,v1,1/2] apps: lc-compliance: Commit camera configuration last", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "1ca14457161a6f955fb08e604f48769f79ebc5c9", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/1.1/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/23642/mbox/", "series": [ { "id": 5244, "url": "https://patchwork.libcamera.org/api/1.1/series/5244/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5244", "date": "2025-06-24T12:28:29", "name": "[RFC,v1,1/2] apps: lc-compliance: Commit camera configuration last", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5244/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/23642/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/23642/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 2E35CC3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Jun 2025 12:28:38 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DFF8668DF0;\n\tTue, 24 Jun 2025 14:28:36 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3FC7768DC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Jun 2025 14:28:34 +0200 (CEST)", "from pb-laptop.local (185.221.143.107.nat.pool.zt.hu\n\t[185.221.143.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8ED3C16A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Jun 2025 14:28:16 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"LMt7W5r0\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1750768096;\n\tbh=jHPfh/qyjuoteRmpv19I9+YMo1YX7HcOGVGwbW3nV98=;\n\th=From:To:Subject:Date:From;\n\tb=LMt7W5r0iM/JXOo2omiikkWljzqAGlnwH5dtFrWsjyO5mZR/aTPXSGOiPx+eDzB+D\n\togNUFdF+JKb90j1TNFChpRqYPH5VY3OVPgpEv7Cx/QUd2h0Gc8e5+9GVkUQoBvbMLx\n\tsAQUmc6qcJbaPyv6XgQL69QujbN5ALUKKE5GHxuU=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC PATCH v1 1/2] apps: lc-compliance: Commit camera configuration\n\tlast", "Date": "Tue, 24 Jun 2025 14:28:29 +0200", "Message-ID": "<20250624122830.726987-1-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.50.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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": "Save the result of `Camera::generateConfiguration()` in a local variable,\nand only commit it to the member variable `config_` if it passes all checks.\nThis removes the need for explicit `config_.reset()` calls in error paths,\nhence making things simpler.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/apps/lc-compliance/helpers/capture.cpp | 23 +++++++++-------------\n 1 file changed, 9 insertions(+), 14 deletions(-)", "diff": "diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp\nindex 2a3fa3b68..d076e964a 100644\n--- a/src/apps/lc-compliance/helpers/capture.cpp\n+++ b/src/apps/lc-compliance/helpers/capture.cpp\n@@ -27,35 +27,30 @@ void Capture::configure(libcamera::Span<const libcamera::StreamRole> roles)\n {\n \tassert(!roles.empty());\n \n-\tconfig_ = camera_->generateConfiguration(roles);\n-\tif (!config_)\n+\tauto config = camera_->generateConfiguration(roles);\n+\tif (!config)\n \t\tGTEST_SKIP() << \"Roles not supported by camera\";\n \n-\tASSERT_EQ(config_->size(), roles.size()) << \"Unexpected number of streams in configuration\";\n+\tASSERT_EQ(config->size(), roles.size()) << \"Unexpected number of streams in configuration\";\n \n \t/*\n \t * Set the buffers count to the largest value across all streams.\n \t * \\todo: Should all streams from a Camera have the same buffer count ?\n \t */\n \tauto largest =\n-\t\tstd::max_element(config_->begin(), config_->end(),\n+\t\tstd::max_element(config->begin(), config->end(),\n \t\t\t\t [](const StreamConfiguration &l, const StreamConfiguration &r)\n \t\t\t\t { return l.bufferCount < r.bufferCount; });\n \n-\tassert(largest != config_->end());\n+\tassert(largest != config->end());\n \n-\tfor (auto &cfg : *config_)\n+\tfor (auto &cfg : *config)\n \t\tcfg.bufferCount = largest->bufferCount;\n \n-\tif (config_->validate() != CameraConfiguration::Valid) {\n-\t\tconfig_.reset();\n-\t\tFAIL() << \"Configuration not valid\";\n-\t}\n+\tASSERT_EQ(config->validate(), CameraConfiguration::Valid);\n+\tASSERT_EQ(camera_->configure(config.get()), 0);\n \n-\tif (camera_->configure(config_.get())) {\n-\t\tconfig_.reset();\n-\t\tFAIL() << \"Failed to configure camera\";\n-\t}\n+\tconfig_ = std::move(config);\n }\n \n void Capture::run(unsigned int captureLimit, std::optional<unsigned int> queueLimit)\n", "prefixes": [ "RFC", "v1", "1/2" ] }