From patchwork Tue Sep 15 14:20:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 9633 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 270E8BF01C for ; Tue, 15 Sep 2020 14:21:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EB0DC62E3D; Tue, 15 Sep 2020 16:21:48 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="txHN8gA3"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 67D2062E32 for ; Tue, 15 Sep 2020 16:21:47 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id ABC4010C6; Tue, 15 Sep 2020 16:21:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1600179707; bh=iyjeV0BSwEVTg0w/laQbVt45nmFu0svAY8+ltV2mxXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=txHN8gA3WSksjas/yYY9XzAkDbMBdhbMIbH8hLfz2oWoujGGz+BAzLvDtCi/netLk qGRX5jEn4oCddPq5RSab+fD6Y7+Ndzzbb08UrgGnovlSmpzAUaTZ3KZtWxlJS5qSFT mNTyJVzjbqQHG6HhydemYrEWDorh1/PrsFOthbb0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Tue, 15 Sep 2020 23:20:38 +0900 Message-Id: <20200915142038.28757-24-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200915142038.28757-1-paul.elder@ideasonboard.com> References: <20200915142038.28757-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 23/23] libcamera: PipelineHandler: Move printing pipeline names to CameraManager 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" Since pipeline registration is done with declaring static factory objects, there is a risk that pipeline factories will be constructed before libcamera facilities are ready. For example, logging in the constructor of a pipeline handler factory may cause a segfault if threading isn't ready yet. Avoid this issue by moving printing the registration of the pipeline handler to the camera manager. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- src/libcamera/camera_manager.cpp | 2 ++ src/libcamera/pipeline_handler.cpp | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index b8d3ccc8..e5af271d 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -142,6 +142,8 @@ void CameraManager::Private::createPipelineHandlers() PipelineHandlerFactory::factories(); for (PipelineHandlerFactory *factory : factories) { + LOG(Camera, Debug) + << "Found registered pipeline handler \"" << factory->name() << "\""; /* * Try each pipeline handler until it exhaust * all pipelines it can provide. diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index 918aea1e..894200ee 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -689,9 +689,6 @@ void PipelineHandlerFactory::registerType(PipelineHandlerFactory *factory) std::vector &factories = PipelineHandlerFactory::factories(); factories.push_back(factory); - - LOG(Pipeline, Debug) - << "Registered pipeline handler \"" << factory->name() << "\""; } /**