From patchwork Sat Jan 26 16:28:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 408 Return-Path: Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C6EA60C7F for ; Sat, 26 Jan 2019 17:28:54 +0100 (CET) X-Originating-IP: 79.18.49.20 Received: from uno.homenet.telecomitalia.it (host20-49-dynamic.18-79-r.retail.telecomitalia.it [79.18.49.20]) (Authenticated sender: jacopo@jmondi.org) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id E364420004; Sat, 26 Jan 2019 16:28:53 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sat, 26 Jan 2019 17:28:59 +0100 Message-Id: <20190126162859.32031-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190126162859.32031-1-jacopo@jmondi.org> References: <20190126162859.32031-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/2] libcamera: ipu3: Re-work camera data registration X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2019 16:28:55 -0000 Re-work camera data registration. Signed-off-by: Jacopo Mondi --- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 64f639f..80f4a7b 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -210,18 +210,16 @@ void PipelineHandlerIPU3::registerCameras() * registered. The 'camera' shared pointer goes out of scope * and deletes the Camera it manages. */ - V4L2Device *videoDev = createVideoDevice(id); - if (!videoDev) { + std::unique_ptr data = utils::make_unique(); + data->dev_ = createVideoDevice(id); + if (!data->dev_) { LOG(IPU3, Error) << "Failed to register camera[" << numCameras << "] \"" << cameraName << "\""; continue; } - IPU3CameraData *data = new IPU3CameraData(); - data->dev_ = videoDev; - setCameraData(camera.get(), - std::move(std::unique_ptr(data))); + setCameraData(camera.get(), std::move(data)); registerCamera(std::move(camera)); LOG(IPU3, Info)