From patchwork Fri Sep 18 07:59:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 28327 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 C2B6FC335C for ; Fri, 18 Sep 2026 08:08:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 62C316873D; Fri, 18 Sep 2026 10:08:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="hwJmGzmw"; dkim-atps=neutral Received: from mail-wr2-x10.google.com (mail-wr2-x10.google.com [IPv6:2a00:1450:4864:30::10]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1BBD168729 for ; Fri, 18 Sep 2026 10:07:54 +0200 (CEST) Received: by mail-wr2-x10.google.com with SMTP id ffacd0b85a97d-482e1b55da9so52035f8f.2 for ; Fri, 18 Sep 2026 01:07:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1789718873; x=1790323673; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=u35DaInxKIpWOADY4U2RwpXQnFNjn7InXH9ThmG/FGY=; b=hwJmGzmwGFP9pr6xQVxER0qxdLD1OBfIcmrV4+hhBKkYUdxYljM4slpoNl0m/iYfzz f/KnWCbZeDOsn68rj6BYxEh5gn6T1lPGN34lheAdmTDyXoehSb4r778HrlFY2LgalQRn tRjoGxb36mYOq6rnrREbcj5y9mrQb8u/31cJnEjCPK74FB3N0JrGZJFTbDDFgQKCmkgd zu0R/2IFj7838Y535a+KRlnFmorkkQXgTbpTo45oTCbvKUR2Rfq1TwiRjppoXN2rtNRd p2ETdr1H0i95bpjJRgoZra5xbLcnXS2WVKVqhGIifArhoqHio+4ax1pMWEY9t9qokt+s WRzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789718873; x=1790323673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=u35DaInxKIpWOADY4U2RwpXQnFNjn7InXH9ThmG/FGY=; b=H3Ja7p1+zcPbutM2jScIIykc6aEns83Ktqc5FeObzjWVPXEvEF9og8DJ41t1NN8qqZ M7IU5SAizSmC6tLBqUhe4t5Wc3FxpKU5SGeCu2EwXaWQAH0sUX1NeEuyNJ+sg/uX4W/T XiJfplt62T2AmhbgKWxfTFmO/MTSXJSGAB+CeVq2v0i0/PFTPXxTZzamhna/Bd225TbA z0EO7VfgbAryUb0Ii5HzeMj/57Qcp7WaG3m9Qj8NqT4fLrT5lE+D1Z9IsL19u8ciKYoX SqEE65r6PnQ+2oEc9BsOXDR56Ozl3tvLgkaz7WZxQBRPJf58YlqGMwyv/zuHkkWli8Yg 5N/w== X-Gm-Message-State: AFuF++nTZYv1fTB9E0MqAHelqNU5TbyFeMO8+WPUBkfUKOBkkhEOCJi0 gdNDXKHdILKfEeBG7OY4Asc940+FaCCZ399CwipZWK2l3qq9yHeDR2ex9T/bNdNpu/Mxa8gWgBq Mk7i8M+c= X-Gm-Gg: AYBFou2GhXcXClSWOE26xytypYSTDlrJeNxX8l+dHr9NIaX1i++osBhAJyMn0piC9nO W0C/a19giv5f2XNrSreXdHbzMB0u8XEgyBBu7nBJIuQjeS2SHoUhpoe9StgDKV3SZj4Ha0ohtmT q8zhgQpOvo/JXiVdpjd+tSLVWQNjxvX5C6sbcS6uN+roZmaqoLU3hutI8zuhARAjSJT3ak500Ji rgut+UcCsiwoUeZzdbnzkT50JGwSUcxW8srY9kH+QRFluTqqp0wNqCR6YElkQso6WBwR9QmK6Ei ApzbT77oLHuAD8RT4SjlEeNE8OMyHy+qdpsrQD17xHuM/jXVncpSVTeNLe90tfJorXfemSZ84Ru psf/NJUY9aPFmT3IWpGnOHs8RBAF0pSbiAggi4nLfXLDt5Gq0i29nxKEktGPqARDBC1GEgQw9ia JrGySZkJHgfcYmopU/3lUO52U7Gz3mJmmO9NiLmHHzH/GbbcX2cv4dOYm1HEAaPDoE3oiNrBxE2 KbZFIUsMVK2pnFl4FFYMz7VvcUr4c9qkgUIkdfFoHJok5kxIqxVOSYiOpI9kkeq7GEKTv1zS6Ow GYJW4FwTcQueiclVSeYxSwUHsTEHesXEBy91nwR8MCnYIOUndDH3a1sv/rmR8eOQwF1WZaCHmlg 6/FYPqE0qVSyd1atG/5nopOraitSRUVYtjVVvH5/X6HVlVw== X-Received: by 2002:a05:6000:18a3:b0:487:a7a:72cd with SMTP id ffacd0b85a97d-4871fa97755mr1486091f8f.5.1789718873536; Fri, 18 Sep 2026 01:07:53 -0700 (PDT) Received: from naush-dell.pitowers.org ([2a00:1098:3142:1f:45e3:df8b:2b18:6253]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-487203f077fsm1742230f8f.26.2026.09.18.01.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2026 01:07:53 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH v1 15/20] libcamera: pipeline_handler: Make match() optional Date: Fri, 18 Sep 2026 08:59:53 +0100 Message-ID: <20260918080734.1228227-16-naush@raspberrypi.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260918080734.1228227-1-naush@raspberrypi.com> References: <20260918080734.1228227-1-naush@raspberrypi.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" The camera manager creates the cameras of pipeline handlers that support surveying without ever calling their match(), which leaves the match() implementations of those handlers unreachable. Give match() a default implementation matching no device, so that pipeline handlers supporting enumeration can implement survey() and createCamera() only. Signed-off-by: Naushir Patuck --- include/libcamera/internal/pipeline_handler.h | 2 +- src/libcamera/pipeline_handler.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h index 1f82ff998514..4baac2fa87fa 100644 --- a/include/libcamera/internal/pipeline_handler.h +++ b/include/libcamera/internal/pipeline_handler.h @@ -40,7 +40,7 @@ public: unsigned int maxQueuedRequestsDevice = 32); virtual ~PipelineHandler(); - virtual bool match(DeviceEnumerator *enumerator) = 0; + virtual bool match(DeviceEnumerator *enumerator); virtual int survey(const DeviceEnumerator *enumerator, std::vector> *descriptors); virtual int createCamera(const CameraDescriptor *descriptor); diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 6023d028f40b..7bc778b053b6 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -109,11 +109,20 @@ PipelineHandler::~PipelineHandler() * If this function returns true, a new instance of the pipeline handler will * be created and its match() function called. * + * Pipeline handlers that report their cameras through survey() have them + * created by the camera manager without this function being called, and + * therefore do not need to implement it. The default implementation matches + * no device. + * * \context This function is called from the CameraManager thread. * * \return true if media devices have been acquired and camera instances * created, or false otherwise */ +bool PipelineHandler::match([[maybe_unused]] DeviceEnumerator *enumerator) +{ + return false; +} /** * \brief Survey the media devices for cameras this pipeline handler supports