From patchwork Thu Jun 11 17:16:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 4026 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 8612561DFC for ; Thu, 11 Jun 2020 19:16:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="gV02pM6i"; 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=dziieE3rjqgnky53UeH/783O3RqTH7OtjKspSaaGZvM=; b=gV02pM6iLLtRHyaazn3qkoCIlpLqiludPZ3jQsZIQO2k/d9f9ivFOod8UI1ERSiIiFOP WELeS5SbXcdjX1YfiVN4mxOLHcgiOn701sumFHkvdeNcWfvQEFc9mCP6sQ6y/m+qkR5+Qk s1cCZX32gW3xEnWg0x//oCU79juUPMJiM= Received: by filterdrecv-p3iad2-784dbb6bd8-p7j56 with SMTP id filterdrecv-p3iad2-784dbb6bd8-p7j56-17-5EE266D4-7 2020-06-11 17:16:04.216290268 +0000 UTC m=+680945.016001562 Received: from mail.uajain.com (unknown) by ismtpd0008p1hnd1.sendgrid.net (SG) with ESMTP id rpAEfMy_SMqsn1TiB_m4Dg Thu, 11 Jun 2020 17:16:03.800 +0000 (UTC) From: Umang Jain Date: Thu, 11 Jun 2020 17:16:04 +0000 (UTC) Message-Id: <20200611171528.9381-3-email@uajain.com> In-Reply-To: <20200611171528.9381-1-email@uajain.com> References: <20200611171528.9381-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcIgOyDPOiX995eQdp4XFd3BFl5pNeueaPJmHuUAql2udzi84Ctd4sLAv7MxzkKZ0Pkz4DRH5DBvV1uGTjK34SzpoM0WHHfx2TCp0BYAQ9yp3B4e9uxqk4HBrJFKrzBIoS1YsGQJtiHI0G3E5wLLfgDUxWVSbbQyR2h+vLyhjUnrLi7tcwiSUetHlnp0NQgHEmLiRkb1cB6tA07NV3Hh0Lsw== To: laurent.pinchart@ideasonboard.com, libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH v4 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: Thu, 11 Jun 2020 17:16:06 -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 b8128df..aba5a0c 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -56,6 +56,7 @@ protected: private: int init(); void cleanup(); + void createPipelineHandlers(); 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 and pipeline handlers to ensure