From patchwork Tue Jun 16 19:45:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 4066 Return-Path: Received: from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7F9DE603C4 for ; Tue, 16 Jun 2020 21:45:36 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="GerWgxdu"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com; h=from:subject:in-reply-to:references:mime-version:to:cc: content-transfer-encoding:content-type; s=s1; bh=FikAzZVC5wWvR5l9nNnuXN41hQ1xpsTkcWITVMaV9w8=; b=GerWgxduibsIj9F3tbfZDEIXqcl+BuRVysv8F1VBaHCtXCgxwwqpRIsO3MLhjCfdXH9n W7b0arLfGisO5g2/L3ez/hWRc4Cqhm2ZaExUiE0zL/pm0rvvoEUaUY9ghT33hSCCi/OsqR Qpp5PtvBLC6DLbi7ThbApgD70NDtC6V7k= Received: by filter0088p3las1.sendgrid.net with SMTP id filter0088p3las1-13542-5EE9215E-EB 2020-06-16 19:45:34.897993716 +0000 UTC m=+696962.422127552 Received: from mail.uajain.com (unknown) by ismtpd0007p1maa1.sendgrid.net (SG) with ESMTP id UUHnVglXTjO3BhjCr1MdVg Tue, 16 Jun 2020 19:45:34.523 +0000 (UTC) From: Umang Jain Date: Tue, 16 Jun 2020 19:45:34 +0000 (UTC) Message-Id: <20200616194523.23268-3-email@uajain.com> In-Reply-To: <20200616194523.23268-1-email@uajain.com> References: <20200616194523.23268-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPclq38gSC/txiORZpK15NbTiNN4t34vkHbngDjoVHubyaJU1FuzYgc2u/UQviNeN62Dkfco7jq6QVug6u9j3fxs8okeTO/ce1eJ7rurDyE5Ai3aobw0oNnF61atrYFR6MAd4MRqqec6qNNBOZtbe4JSDW/ftj6oPfP7EmQZhX2x8q+sAmAyMiK+00DNu/VWf29 To: laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH v5 2/6] libcamera: camera_manager: Refactor pipelines creation into separate function 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: , X-List-Received-Date: Tue, 16 Jun 2020 19:45:37 -0000 This commit introduces no functional changes. Split pipelines creation code into a separate function, so that the function can be re-used for upcoming hotplug functionality in subsequent commits. Also, fixup correct tag for \todo. Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart --- src/libcamera/camera_manager.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index dbdc78e..de6d5d8 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -55,6 +55,7 @@ protected: private: int init(); + void createPipelineHandlers(); void cleanup(); CameraManager *cm_; @@ -123,12 +124,20 @@ int CameraManager::Private::init() if (!enumerator_ || enumerator_->enumerate()) return -ENODEV; + createPipelineHandlers(); + + return 0; +} + +void CameraManager::Private::createPipelineHandlers() +{ /* - * TODO: Try to read handlers and order from configuration + * \todo Try to read handlers and order from configuration * file and only fallback on all handlers if there is no * configuration file. */ - std::vector &factories = PipelineHandlerFactory::factories(); + std::vector &factories = + PipelineHandlerFactory::factories(); for (PipelineHandlerFactory *factory : factories) { /* @@ -146,14 +155,12 @@ int CameraManager::Private::init() } } - /* TODO: register hot-plug callback here */ - - return 0; + /* \todo Register hot-plug callback here */ } void CameraManager::Private::cleanup() { - /* TODO: unregister hot-plug callback here */ + /* \todo Unregister hot-plug callback here */ /* * Release all references to cameras to ensure they all get destroyed