From patchwork Mon Jun 29 16:30:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 27119 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 52613C3261 for ; Mon, 29 Jun 2026 16:31:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EE24D65FC7; Mon, 29 Jun 2026 18:31:31 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="lfeNlG6R"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5362465F2C for ; Mon, 29 Jun 2026 18:30:30 +0200 (CEST) Received: from pb-laptop.local (185.221.140.128.nat.pool.zt.hu [185.221.140.128]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 2B00DE91 for ; Mon, 29 Jun 2026 18:29:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782750587; bh=I16+fIsMsBuYE2MczZTvkNlv97XF1oFMoVrjPo25gbQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lfeNlG6RV1zNe+s4Lz0Bzlll5YnAt43Jbno4Zq9Q2xfJ+741ywwtCFhq6lvpsrAz+ 1qml+51rTP/8aXLqJOn/x306nggpScUgWqiRo2xcoAuLSjHYtsby+zqLOpchZxr1Zz IoseO1s9pRFI5Xgz3kCPdVz21T0R8BnV+1MGrzTo= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 41/54] app: lc-compliance: Use camera buffer pool Date: Mon, 29 Jun 2026 18:30:04 +0200 Message-ID: <20260629163017.863145-42-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260629163017.863145-1-barnabas.pocze@ideasonboard.com> References: <20260629163017.863145-1-barnabas.pocze@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Convert the `lc-compliance` application to use the new buffer pool interface of cameras. Signed-off-by: Barnabás Pőcze --- src/apps/lc-compliance/helpers/capture.cpp | 23 ++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp index d83269d4a9..2a645b4445 100644 --- a/src/apps/lc-compliance/helpers/capture.cpp +++ b/src/apps/lc-compliance/helpers/capture.cpp @@ -88,6 +88,9 @@ int Capture::queueRequest(libcamera::Request *request) if (queueLimit_ && queueCount_ >= *queueLimit_) return 0; + for (const auto &cfg : *config_) + request->enableStream(cfg.stream(), true); + int ret = camera_->queueRequest(request); if (ret < 0) return ret; @@ -107,7 +110,10 @@ void Capture::requestComplete(Request *request) EXPECT_EQ(request->status(), Request::Status::RequestComplete) << "Request didn't complete successfully"; - request->reuse(Request::ReuseBuffers); + for (const auto &[stream, buffer] : request->buffers()) + camera_->addBuffer(stream, buffer); + + request->reuse(); if (queueRequest(request)) loop_->exit(-EINVAL); } @@ -141,11 +147,6 @@ void Capture::start() const auto &buffers = allocator_.buffers(stream); ASSERT_EQ(buffers.size(), bufferCount) << "Mismatching buffer count"; - - for (std::size_t i = 0; i < bufferCount; i++) { - ASSERT_EQ(requests_[i]->addBuffer(stream, buffers[i].get()), 0) - << "Failed to add buffer to request"; - } } ASSERT_TRUE(allocator_.allocated()); @@ -153,6 +154,16 @@ void Capture::start() camera_->requestCompleted.connect(this, &Capture::requestComplete); ASSERT_EQ(camera_->start(), 0) << "Failed to start camera"; + + for (const auto &cfg : *config_) { + Stream *stream = cfg.stream(); + const auto &buffers = allocator_.buffers(stream); + + for (std::size_t i = 0; i < bufferCount; i++) { + ASSERT_EQ(camera_->addBuffer(stream, buffers[i].get()), 0) + << "Failed to add buffer"; + } + } } void Capture::stop()