From patchwork Mon Dec 9 17:48:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 22262 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 2EFCFBD80A for ; Mon, 9 Dec 2024 17:48:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 77B9467E74; Mon, 9 Dec 2024 18:48:13 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SsihS3I5"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D207966132 for ; Mon, 9 Dec 2024 18:48:11 +0100 (CET) Received: from pb-laptop.local (185.221.143.90.nat.pool.zt.hu [185.221.143.90]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 053B1502 for ; Mon, 9 Dec 2024 18:47:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1733766460; bh=UQIX/9EeIYX+XoqtMfPYpX56t3PKVaz3iwpJ+1qMiXY=; h=From:To:Subject:Date:From; b=SsihS3I52LcL7GE5exFrYcnzWFbNHuIxW/GEft16bY3kdSmdgINIvXnbbnBnZymLS pzYn75MJCYnjHypyo75x/DR4xR0F1dWfQMbwLNZAqDQ9eETVeb1x7We10dAGX/se4q Nt3wv6MvFqiTwcbvkWX4Uvh5J23a6ahO7NZwo+KE= From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= To: libcamera-devel@lists.libcamera.org Subject: [PATCH v1 1/6] Documentation: guides: pipeline-handler: Fix camera creation Date: Mon, 9 Dec 2024 18:48:01 +0100 Message-ID: <20241209174806.283905-1-barnabas.pocze@ideasonboard.com> X-Mailer: git-send-email 2.47.1 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" 1. The unique_ptr containing the private data must be passed to `Camera::create()`. 2. `registerCamera()` needs only the pointer to the `Camera` Signed-off-by: Barnabás Pőcze Reviewed-by: Kieran Bingham --- Documentation/guides/pipeline-handler.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst index 69e832a55..94527c401 100644 --- a/Documentation/guides/pipeline-handler.rst +++ b/Documentation/guides/pipeline-handler.rst @@ -527,8 +527,8 @@ PipelineHandler successfully matched and constructed a device. .. code-block:: cpp std::set streams{ &data->stream_ }; - std::shared_ptr camera = Camera::create(this, data->video_->deviceName(), streams); - registerCamera(std::move(camera), std::move(data)); + std::shared_ptr camera = Camera::create(std::move(data), data->video_->deviceName(), streams); + registerCamera(std::move(camera)); return true; @@ -554,8 +554,7 @@ Our match function should now look like the following: /* Create and register the camera. */ std::set streams{ &data->stream_ }; - const std::string &id = data->video_->deviceName(); - std::shared_ptr camera = Camera::create(data.release(), id, streams); + std::shared_ptr camera = Camera::create(std::move(data), data->video_->deviceName(), streams); registerCamera(std::move(camera)); return true;