From patchwork Thu Feb 11 08:55:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11235 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 9A1ABBD162 for ; Thu, 11 Feb 2021 08:55:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 692F36346C; Thu, 11 Feb 2021 09:55:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="GN6BdRoX"; 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 6897261630 for ; Thu, 11 Feb 2021 09:55:42 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E495841; Thu, 11 Feb 2021 09:55:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613033742; bh=R2CGovBWzgwEKSGlaFhBGGrk0+ein2BLpXEATT1Xe+g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GN6BdRoXuuoqGMvdxkb1i+3NhwcAwh+d27nePbMIfLjOAqKLu1k7EVRm1fIGa/8Zb eQLut4dV4jSbM8oqGcKV58OX4zmmhLyC0VbAMT1HZTnWhEbk+ZsE8DzqrasBaj0j6C pHMyXC/dgKRNKftDHKIrPylzW16yFy1iizA8yEvg= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 11 Feb 2021 17:55:25 +0900 Message-Id: <20210211085527.44667-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210211085527.44667-1-paul.elder@ideasonboard.com> References: <20210211085527.44667-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] libcamera: properties: Add Unknown value to camera Location 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" If a camera's location is unknown, it should be set so, and not defaulted to another location. Add such a value to the Location property enum. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/property_ids.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml index 104e9aaf..66deaa84 100644 --- a/src/libcamera/property_ids.yaml +++ b/src/libcamera/property_ids.yaml @@ -25,6 +25,10 @@ controls: description: | The camera is attached to the device in a way that allows it to be moved freely + - name: CameraLocationUnknown + value: 3 + description: | + The camera location is unknown - Rotation: type: int32_t From patchwork Thu Feb 11 08:55:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11236 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 40285BD162 for ; Thu, 11 Feb 2021 08:55:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D65DC6169C; Thu, 11 Feb 2021 09:55:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Du0Stm5M"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6461E61630 for ; Thu, 11 Feb 2021 09:55:44 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D759941; Thu, 11 Feb 2021 09:55:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613033744; bh=QL1oY54KHlcZZ+Ip5RSkan5dTQQOAff10ZtsclRYJu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Du0Stm5MnbhfWwPT9FepgO9qKu8E3kj+YLOg4uAz15mJKMlgVCpeHm8SFQhc6RVA3 taBP2W3TcIN414535zngOjmn1EshlezbNNgMRa4driG/VqsWnTqp4geYYuTne6re9L cn3Ek/0yyD8Tr9NAJyduLl1LzKOQp6dZOWgEM68c= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 11 Feb 2021 17:55:26 +0900 Message-Id: <20210211085527.44667-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210211085527.44667-1-paul.elder@ideasonboard.com> References: <20210211085527.44667-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/3] libcamera: camera_sensor: Set default sensor location to Unknown 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" Instead of choosing some arbitrary location for the sensor when its location is unknown, set it explicitly to unknown. Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/libcamera/camera_sensor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index c9e8d49b..474055ba 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -446,7 +446,7 @@ int CameraSensor::initProperties() break; } } else { - propertyValue = properties::CameraLocationExternal; + propertyValue = properties::CameraLocationUnknown; } properties_.set(properties::Location, propertyValue); From patchwork Thu Feb 11 08:55:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11237 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 5D2F8BD162 for ; Thu, 11 Feb 2021 08:55:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 294716373E; Thu, 11 Feb 2021 09:55:47 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="SE0HvJc/"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EA6F61630 for ; Thu, 11 Feb 2021 09:55:46 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id CA05B41; Thu, 11 Feb 2021 09:55:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613033746; bh=SGlJpVIsswTvQ06AQ4tmYhpdpzuBnQdKH6Jhr4QGotE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SE0HvJc/H6RBwhQrUk91+jjOEZf/RiF7JGQCGvjKQaCQMEgBt58/uJItxtiucoMpQ FI5zBpen1qhnzqjyjj35Z47ls1IUtVNv9HwCKUuzGaGpTw9Fw0uFujTlEub8g5Xu6L NObRXrmSIlG5Ybp6YGvIMOUQ2azqHNVfpUp4AcO4= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 11 Feb 2021 17:55:27 +0900 Message-Id: <20210211085527.44667-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210211085527.44667-1-paul.elder@ideasonboard.com> References: <20210211085527.44667-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] android: camera_device: Default the camera location to Front 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" Since the libcamera camera now has an Unknown location, we can know if the camera's location is actually unknown. In this case, set the android camera location to front, as some systems may not support external cameras. This allows the following CTS test to pass: - android.hardware.camera2.cts.CameraManagerTest#testCameraManagerGetDeviceIdList Signed-off-by: Paul Elder Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 1e2a5b5f..3d815d21 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -407,6 +407,9 @@ int CameraDevice::initialize() case properties::CameraLocationExternal: facing_ = CAMERA_FACING_EXTERNAL; break; + case properties::CameraLocationUnknown: + facing_ = CAMERA_FACING_FRONT; + break; } }