From patchwork Wed Aug 5 12:53:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9222 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 C1E65BD87A for ; Wed, 5 Aug 2020 12:53:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3500F605A8; Wed, 5 Aug 2020 14:53:53 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="pUeFh41Q"; dkim-atps=neutral Received: from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6BB386039D for ; Wed, 5 Aug 2020 14:53:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type; s=s1; bh=kvobH4AiFqw5kfUny/Y7QgPTeMqGgqZeV3uapVQD6AQ=; b=pUeFh41QZdG/JxPw4/LFQA9Gv7k3eWoCYJw9lcr/CBzK6mrjdiAbq0aSOVy8S/0WHn6H RGatZalMdRMLUj1hR/X3su7VXTVLqvU6gHD7j7qFvqQ6B/MPNOj0kxrdu8/miJvnURbfbF zeVH/dsA39DVW1G3+tuNhn3TzvWsJSh8o= Received: by filterdrecv-p3las1-559bd7b968-jcwlk with SMTP id filterdrecv-p3las1-559bd7b968-jcwlk-20-5F2AABDD-6 2020-08-05 12:53:49.138719059 +0000 UTC m=+585464.947727224 Received: from mail.uajain.com (unknown) by ismtpd0001p1hnd1.sendgrid.net (SG) with ESMTP id mYpIEEhJTMmR21XjS_hyjA for ; Wed, 05 Aug 2020 12:53:48.742 +0000 (UTC) From: Umang Jain Date: Wed, 05 Aug 2020 12:53:49 +0000 (UTC) Message-Id: <20200805125343.116183-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcu2AmDZxpR9j2S9uUCg9Ys7IhJGIFuKZoi7yRKl0UwuNdPXF3ZXaaD5mrHJVqoTM/fqIJW3Q28o/hK/NXMvlnVjBhdTUo8DOSqb2BcPj2HSdjMIpvRBuhnFOYKKKP0BhrBdnvvTHmw9CLstgm7KHvilkNin2bfMbphHj56RWX7UboMwIQoMhTazRXyAs5Rii/BF5a4AybodHrBnazKDhNTg== To: libcamera-devel@lists.libcamera.org Subject: [libcamera-devel] [PATCH] android: camera_device: Initialize 'id_' field in constructor 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" A 'id' is passed when a new CameraDevice is constructed in order for unique identification. Failing to initialize it, will lead to the issue of garbage return value via CameraDevice::id(). Signed-off-by: Umang Jain Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/android/camera_device.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index c1e5812..55057f9 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -163,7 +163,7 @@ CameraDevice::Camera3RequestDescriptor::~Camera3RequestDescriptor() */ CameraDevice::CameraDevice(unsigned int id, const std::shared_ptr &camera) - : running_(false), camera_(camera), staticMetadata_(nullptr), + : id_(id), running_(false), camera_(camera), staticMetadata_(nullptr), facing_(CAMERA_FACING_FRONT), orientation_(0) { camera_->requestCompleted.connect(this, &CameraDevice::requestComplete);