From patchwork Fri Oct 2 14:31:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 9912 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 6B29DC3B5C for ; Fri, 2 Oct 2020 14:32:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3A3B363B72; Fri, 2 Oct 2020 16:32:15 +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="UU5SFXn8"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9AB2763B6A for ; Fri, 2 Oct 2020 16:32:13 +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 38F402A2; Fri, 2 Oct 2020 16:32:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1601649133; bh=C5e/tYKbcIgAGB36WLEAVYnxBQ8EfsCOOgtMfV9F9kQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UU5SFXn8iOEohy21RaRn8Lk3O3emOkv+d5KM4g738o0HpajW3WX7h26sBGdjGmMcz LNHr94XEoca/uXV+lnngupwymfVXa2j2C1hnzJ2og7++0r8oXUP35osZdNVgXQLnjA pTYri9ICBsHdU2EebEh6/qK00WG5edGQua2eKyW0= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 2 Oct 2020 23:31:19 +0900 Message-Id: <20201002143154.468162-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201002143154.468162-1-paul.elder@ideasonboard.com> References: <20201002143154.468162-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 03/38] 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 Reviewed-by: Jacopo Mondi --- No change in v3 Cosmetic changes in v2 --- src/libcamera/camera_manager.cpp | 3 +++ src/libcamera/pipeline_handler.cpp | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index b8d3ccc8..756f5b2b 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -142,6 +142,9 @@ 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() << "\""; } /**