{"id":22570,"url":"https://patchwork.libcamera.org/api/patches/22570/?format=json","web_url":"https://patchwork.libcamera.org/patch/22570/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20250114182143.1773762-10-pobrn@protonmail.com>","date":"2025-01-14T18:22:32","name":"[RFC,v2,09/16] apps: lc-compliance: Don't allocate `FrameBufferAllocator` dynamically","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"250b3d287f1567f5e76835dd7073b5a9d12a27b1","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/?format=json","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22570/mbox/","series":[{"id":4951,"url":"https://patchwork.libcamera.org/api/series/4951/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4951","date":"2025-01-14T18:21:46","name":"apps: lc-compliance: Multi-stream tests","version":2,"mbox":"https://patchwork.libcamera.org/series/4951/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22570/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22570/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 B8E0EC3301\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Jan 2025 18:22:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E6F46854A;\n\tTue, 14 Jan 2025 19:22:38 +0100 (CET)","from mail-10628.protonmail.ch (mail-10628.protonmail.ch\n\t[79.135.106.28])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D2A668536\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Jan 2025 19:22:36 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"qbWgplmp\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1736878955; x=1737138155;\n\tbh=dFg6NaZS/ejGUsUCrx8TsDPmCurA3lVC80DO2Jz8mEs=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=qbWgplmpWDqduPvprWedWTbhAtZ+NXTEnr7EjHYI/Zv3LcZg1Jai/wz+fQqMVLl5P\n\twta7EQtHIQ0pnmj4WP44VJXy1/GS+i4Dae5S5Sod4cvDLV1cjU7Hr2HByH+0LoNbPg\n\tf+g0OupdoYvyVMGBOv5eS0k2HlkRlXw80jT9/cF6n0q8asfnsO+1h04C/Rx6MwZwJG\n\t/icxYREuqedPsIq9s3jxxqG7nGPzNJBnAa7yOjDw9VcEhg5AkGKQwjfY5NjnF1HRq6\n\tIbGn8+fbAJ1g4kFVUuiiIJQ0rvZNuaBosB9J9r+ZuARY0XMHZa7/feZi4HmHWfyrPh\n\tTf8QCtXZ/FfjQ==","Date":"Tue, 14 Jan 2025 18:22:32 +0000","To":"libcamera-devel@lists.libcamera.org","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"[RFC PATCH v2 09/16] apps: lc-compliance: Don't allocate\n\t`FrameBufferAllocator` dynamically","Message-ID":"<20250114182143.1773762-10-pobrn@protonmail.com>","In-Reply-To":"<20250114182143.1773762-1-pobrn@protonmail.com>","References":"<20250114182143.1773762-1-pobrn@protonmail.com>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"85c058acd4f6844cbe1d43d9caf70ef40a8e09da","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":"There is no reason to do so.\n\nSigned-off-by: Barnabás Pőcze <pobrn@protonmail.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/apps/lc-compliance/helpers/capture.cpp | 12 ++++++------\n src/apps/lc-compliance/helpers/capture.h   |  2 +-\n 2 files changed, 7 insertions(+), 7 deletions(-)","diff":"diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp\nindex d1dafb6cf..91c4d4400 100644\n--- a/src/apps/lc-compliance/helpers/capture.cpp\n+++ b/src/apps/lc-compliance/helpers/capture.cpp\n@@ -13,7 +13,7 @@ using namespace libcamera;\n \n Capture::Capture(std::shared_ptr<Camera> camera)\n \t: loop_(nullptr), camera_(std::move(camera)),\n-\t  allocator_(std::make_unique<FrameBufferAllocator>(camera_))\n+\t  allocator_(camera_)\n {\n }\n \n@@ -45,7 +45,7 @@ void Capture::configure(StreamRole role)\n void Capture::start()\n {\n \tStream *stream = config_->at(0).stream();\n-\tint count = allocator_->allocate(stream);\n+\tint count = allocator_.allocate(stream);\n \n \tASSERT_GE(count, 0) << \"Failed to allocate buffers\";\n \tEXPECT_EQ(count, config_->at(0).bufferCount) << \"Allocated less buffers than expected\";\n@@ -57,7 +57,7 @@ void Capture::start()\n \n void Capture::stop()\n {\n-\tif (!config_ || !allocator_->allocated())\n+\tif (!config_ || !allocator_.allocated())\n \t\treturn;\n \n \tcamera_->stop();\n@@ -66,7 +66,7 @@ void Capture::stop()\n \n \tStream *stream = config_->at(0).stream();\n \trequests_.clear();\n-\tallocator_->free(stream);\n+\tallocator_.free(stream);\n }\n \n /* CaptureBalanced */\n@@ -81,7 +81,7 @@ void CaptureBalanced::capture(unsigned int numRequests)\n \tstart();\n \n \tStream *stream = config_->at(0).stream();\n-\tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator_->buffers(stream);\n+\tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator_.buffers(stream);\n \n \t/* No point in testing less requests then the camera depth. */\n \tif (buffers.size() > numRequests) {\n@@ -153,7 +153,7 @@ void CaptureUnbalanced::capture(unsigned int numRequests)\n \tstart();\n \n \tStream *stream = config_->at(0).stream();\n-\tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator_->buffers(stream);\n+\tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator_.buffers(stream);\n \n \tcaptureCount_ = 0;\n \tcaptureLimit_ = numRequests;\ndiff --git a/src/apps/lc-compliance/helpers/capture.h b/src/apps/lc-compliance/helpers/capture.h\nindex 19b6927c6..a4cc3a99e 100644\n--- a/src/apps/lc-compliance/helpers/capture.h\n+++ b/src/apps/lc-compliance/helpers/capture.h\n@@ -30,7 +30,7 @@ protected:\n \tEventLoop *loop_;\n \n \tstd::shared_ptr<libcamera::Camera> camera_;\n-\tstd::unique_ptr<libcamera::FrameBufferAllocator> allocator_;\n+\tlibcamera::FrameBufferAllocator allocator_;\n \tstd::unique_ptr<libcamera::CameraConfiguration> config_;\n \tstd::vector<std::unique_ptr<libcamera::Request>> requests_;\n };\n","prefixes":["RFC","v2","09/16"]}