{"id":22431,"url":"https://patchwork.libcamera.org/api/1.1/patches/22431/?format=json","web_url":"https://patchwork.libcamera.org/patch/22431/","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":"<20241220150759.709756-6-pobrn@protonmail.com>","date":"2024-12-20T15:08:25","name":"[RFC,v1,05/12] 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/1.1/people/133/?format=json","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22431/mbox/","series":[{"id":4923,"url":"https://patchwork.libcamera.org/api/1.1/series/4923/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4923","date":"2024-12-20T15:08:03","name":"apps: lc-compliance: Multi-stream tests","version":1,"mbox":"https://patchwork.libcamera.org/series/4923/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22431/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22431/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 774B6C3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 15:08:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 34C38684AB;\n\tFri, 20 Dec 2024 16:08:32 +0100 (CET)","from mail-40134.protonmail.ch (mail-40134.protonmail.ch\n\t[185.70.40.134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DAB8A6849B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 16:08:30 +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=\"dT7RtF+E\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1734707310; x=1734966510;\n\tbh=czeInqymJn87RyMONeijTyPwqNtDX9fQTMA0VzZy9ec=;\n\th=Date:To:From: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=dT7RtF+EkUutxBYYWG05ILLPVAYG1mQeA3A1TlnExl1XRcO/Y/O5/jOIPLHdHvTgS\n\tNOKnU6X3HvN4mg0REPQHQwGUBc3861swI5WFaJToHinkR5aRvpxAyHCFWvDgx2VXOr\n\ts6hwCd7T6j8rsKWdmO3PPN64KzLkavVMrmcB6RcwtURl9+5bmR/A4YjOLaNqjBffUh\n\t/BNp6wbxljFk7xPApOPchHkBhnojMicAUkHqnVDQS6BY11ag5it0Bq9CWHhz1b/gTz\n\tpCDESPPKW+cbo5PpPlua/n7rfceXc4n9vSRjfwGScxaAtewq++9xJLhPrJJnqLEAK0\n\tlQyGRv52oIL1w==","Date":"Fri, 20 Dec 2024 15:08:25 +0000","To":"libcamera-devel@lists.libcamera.org","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Subject":"[RFC PATCH v1 05/12] apps: lc-compliance: Don't allocate\n\t`FrameBufferAllocator` dynamically","Message-ID":"<20241220150759.709756-6-pobrn@protonmail.com>","In-Reply-To":"<20241220150759.709756-1-pobrn@protonmail.com>","References":"<20241220150759.709756-1-pobrn@protonmail.com>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"88254bb79732204b8edf1020dda697d23bb7cc5d","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>\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","v1","05/12"]}