From patchwork Wed Mar 24 07:07:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11678 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 237CAC32E7 for ; Wed, 24 Mar 2021 07:08:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CECAB68D69; Wed, 24 Mar 2021 08:08:16 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Q9rxYLkG"; dkim-atps=neutral Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DB69D68D62 for ; Wed, 24 Mar 2021 08:08:12 +0100 (CET) Received: by mail-pj1-x102c.google.com with SMTP id k23-20020a17090a5917b02901043e35ad4aso650667pji.3 for ; Wed, 24 Mar 2021 00:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=t5MwDzkNk5G2yMVMsAXj5zqQX2fgl2OED1OdWzHSIn0=; b=Q9rxYLkGtvYyHbKiQIxcP9Lyma7vsDI3ePqp1dX8SA1SsiqPKIYVujmytpMUGj3wZT /WnAkkKDlUXFUHmbKK/G96Q0Ige+vilkXXCuR+AJ5zq94CwEQR+5iMMyRKof7U4BMfhi qp8i8W17nxrlHqK+OZmo4K+KbUOwCVGTLHyfk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=t5MwDzkNk5G2yMVMsAXj5zqQX2fgl2OED1OdWzHSIn0=; b=npukhwpzCZI12F4pmEEYnAU6QGMTFqCPHqj82kz8FxjPhxArE0tLpFVU24uNvzK0NW VLRhEUTdYnRSUGA6TX4EVdBYhHXPFR64pNysBdgmXPFfHxDN40wUEMLR6t6PQqtlhbj3 r0MxqOrJUnC336lC2BY2kXS08oymJJ0nAzd2buRWEdTBsqnfJT3tOaMCH9UdhuLfWMfO otP78ujFl77uYIu13W4nJu87anWQSV0NF3ATo8WVhwb+IAadne/MMCDD/GaoHjy/6mW+ Qh545Cqd+3ZxdjterMFY0CImG8GwYCNCtErj6EP67681mjjvkFc6zEBqeKsHX2CpmvO2 hEIw== X-Gm-Message-State: AOAM531InYCZgMKPA27hk7IQg80WEGkbI6i7TKkPvnIoxwIidp7KyjUy Sd8APqCZYqnUPF/yDtf7/MnzXUy81Zib6Q== X-Google-Smtp-Source: ABdhPJzNp109bzuscz7LbMNVD4SjfPg3LJQZ3ixrCTCExh2U5k7btTJ0N4sUhUYqAgTliuKZ3VkN9Q== X-Received: by 2002:a17:90a:868c:: with SMTP id p12mr1953197pjn.82.1616569689090; Wed, 24 Mar 2021 00:08:09 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:7c07:24cd:c637:7fab]) by smtp.gmail.com with ESMTPSA id e63sm1246860pfe.208.2021.03.24.00.08.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Mar 2021 00:08:08 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 24 Mar 2021 16:07:52 +0900 Message-Id: <20210324070757.3530377-4-hiroh@chromium.org> X-Mailer: git-send-email 2.31.0.291.g576ba9dcdaf-goog In-Reply-To: <20210324070757.3530377-1-hiroh@chromium.org> References: <20210324070757.3530377-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/8] android: CameraHalManager: Fix a function call of a moved Camera 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" libcamera::Camera::id() is called after std::move() in cameraAdded(). This fixes the issue by not executing std::move(). Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- src/android/camera_hal_manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.31.0.291.g576ba9dcdaf-goog diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp index b501f8db..f70cd8a8 100644 --- a/src/android/camera_hal_manager.cpp +++ b/src/android/camera_hal_manager.cpp @@ -115,7 +115,7 @@ void CameraHalManager::cameraAdded(std::shared_ptr cam) } /* Create a CameraDevice instance to wrap the libcamera Camera. */ - std::unique_ptr camera = CameraDevice::create(id, std::move(cam)); + std::unique_ptr camera = CameraDevice::create(id, cam); int ret = camera->initialize(); if (ret) { LOG(HAL, Error) << "Failed to initialize camera: " << cam->id();