From patchwork Mon Jun 29 16:29:55 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: 27110 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 86880C3261 for ; Mon, 29 Jun 2026 16:31:22 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 02A8965FB8; Mon, 29 Jun 2026 18:31:22 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Hf2e1wMd"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 25A4365F5B for ; Mon, 29 Jun 2026 18:30:28 +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 EFD7F8D4 for ; Mon, 29 Jun 2026 18:29:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782750585; bh=yKt850JBOLibER23MkcXsYZCeB/TFGRIQObBLMLjw4c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Hf2e1wMdpnCupJ2WlVkxwMZeyYgbjEkALR4cLUwkXHtiO6GnqK21EEckAUS4zpyfd 9WYNixs+FuOfy8/3QC8gQC1ApDyq/6v1yAnniGLAzFwjLGE80BXkmSG806oxsIlYmd We103o6HwiBQpja0xJYcjF0A5Eb5+huxDjQLte5E= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [RFC PATCH v1 32/54] libcamera: pipeline_handler: buffersAddedDevice(): New virtual function Date: Mon, 29 Jun 2026 18:29:55 +0200 Message-ID: <20260629163017.863145-33-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" This function allows pipeline handlers to be notified every time new buffers are added to the camera's buffer pool. Signed-off-by: Barnabás Pőcze --- include/libcamera/internal/pipeline_handler.h | 2 ++ src/libcamera/pipeline_handler.cpp | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index d7544642fb..d5b8fdb730 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -103,6 +103,8 @@ protected: virtual bool acquireDevice(Camera *camera); virtual void releaseDevice(Camera *camera); + virtual void buffersAddedDevice(Camera *camera); + CameraManager *manager_; private: diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 36e1509b2b..16f218831c 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -672,10 +672,32 @@ void PipelineHandler::cancelRequest(Request *request) completeRequest(request); } +/** + * \brief Notify about buffer addition + * \param[in] camera The camera + * + * Pipeline handlers may override this function in order to be notified + * after buffers have been added to the camera's buffer pool. + * + * \note This function is only called if the pipeline handler has opted into + * using the buffer pool at construction time. + * + * \context This function is called from the CameraManager thread. + * + * \todo more info? + * + * \sa Camera::addBuffer() + */ +void PipelineHandler::buffersAddedDevice([[maybe_unused]] Camera *camera) +{ +} + void PipelineHandler::buffersAdded(Camera *camera) { if (!options_.usesBufferPool) doQueueRequests(camera); + else + buffersAddedDevice(camera); } /**