From patchwork Fri Feb 12 05:48:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11246 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 CE8E3BD162 for ; Fri, 12 Feb 2021 05:48:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 993D163762; Fri, 12 Feb 2021 06:48:31 +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="OhvjLQwU"; 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 1520C63758 for ; Fri, 12 Feb 2021 06:48:30 +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 D33398B5; Fri, 12 Feb 2021 06:48:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613108909; bh=u9dAiqak9SfYSufq5X3NMWL7le+Xult7koj8lDjhtV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OhvjLQwUe8sKkK0IjYBJDTEOI1taN5hcqqpR76LuAzB+gJ6Zb1LZorDZtQO9w/jhj JQec/3AipFt4eC4q0tqADk4ahYeQg7pxBNXp+uIB/C//son4LI4gGqg9XXNqT4PVtS zlKfTfcq5gcOgCubPtedvZwFiK7Ht217kOK25bwo= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Feb 2021 14:48:13 +0900 Message-Id: <20210212054816.53561-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210212054816.53561-1-paul.elder@ideasonboard.com> References: <20210212054816.53561-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/4] 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 Reviewed-by: Jacopo Mondi --- Changes in v2: - Unknown is now 0, the rest are incremented by 1 --- src/libcamera/property_ids.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml index 104e9aaf..fd17bf0c 100644 --- a/src/libcamera/property_ids.yaml +++ b/src/libcamera/property_ids.yaml @@ -10,18 +10,22 @@ controls: description: | Camera mounting location enum: - - name: CameraLocationFront + - name: CameraLocationUnknown value: 0 + description: | + The camera location is unknown + - name: CameraLocationFront + value: 1 description: | The camera is mounted on the front side of the device, facing the user - name: CameraLocationBack - value: 1 + value: 2 description: | The camera is mounted on the back side of the device, facing away from the user - name: CameraLocationExternal - value: 2 + value: 3 description: | The camera is attached to the device in a way that allows it to be moved freely From patchwork Fri Feb 12 05:48:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11247 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 2D8F0BD162 for ; Fri, 12 Feb 2021 05:48:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F037E63765; Fri, 12 Feb 2021 06:48:33 +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="Mkbmowz+"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65D7F63758 for ; Fri, 12 Feb 2021 06:48:33 +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 67F44124E; Fri, 12 Feb 2021 06:48:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613108912; bh=2ufzNI+bsxDLi0ANeeTgoB/+RCBgT9je6ZEEGngyLFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mkbmowz+7ixtZi0sqAk5lDVi1lrPPD7thXehDEG1FVlF7SAe20nRJ/AoBJVvbu+B0 ngYcAV9zr+m4pOQAZmCZf9cx8bZeOYTTzDv/jvw6D1Bacd+oCC8YxDNB/IE/iPmueH xDQ1idgMTVtAUBDKKSd5emhFZm3MER0H5FPWi2kU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Feb 2021 14:48:14 +0900 Message-Id: <20210212054816.53561-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210212054816.53561-1-paul.elder@ideasonboard.com> References: <20210212054816.53561-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/4] 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 --- No change in v2 --- 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 Fri Feb 12 05:48:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11248 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 8448EBD162 for ; Fri, 12 Feb 2021 05:48:37 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 524B063761; Fri, 12 Feb 2021 06:48:37 +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="BXqRa318"; 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 DA68463758 for ; Fri, 12 Feb 2021 06:48:35 +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 C46C41508; Fri, 12 Feb 2021 06:48:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613108915; bh=57jraHUXuHh17UJzhZUFRqdIz+RlVmGqTx53YPBTeXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BXqRa318RWCJKPwocCUFpXx1vWlYWCGFAdmdWgOvf8rYuuEFhZwVyTVYOMd8iURXn dg7ukG1aL/DBdXD7Ww/EG4c74hR+j89WlTdffR9Syk9t2MSUl/bf98rKZsopYGa3MH toVJ83Y+r25GsNvFOEeUCkrXxfTa8pohorLypqDE= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Feb 2021 14:48:15 +0900 Message-Id: <20210212054816.53561-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210212054816.53561-1-paul.elder@ideasonboard.com> References: <20210212054816.53561-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/4] 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 Reviewed-by: Jacopo Mondi --- No change in v2 --- 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; } } From patchwork Fri Feb 12 05:48:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11249 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 E2313BD162 for ; Fri, 12 Feb 2021 05:48:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AF9AB63761; Fri, 12 Feb 2021 06:48:39 +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="LRulRXhx"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D4B3A6375F for ; Fri, 12 Feb 2021 06:48:37 +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 3FDEFA49; Fri, 12 Feb 2021 06:48:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613108917; bh=dT+AXZJ+6QWkRueJrtMDP3KF6EPQYDbM1CWeLFAKrc0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LRulRXhxybunUAMzZM4iWcRN7a4Jex2+QR+Ha59JI7g9B/3urjlbi0ToU+vxPM6g8 u4GLRi5GJLzhO4Qhd2yY1KBWGp049xZiraXv7Nk9rrVsxP7I1HWkgSnRR3p2XOVJD6 Jtz286Y5SYbTzpF1R4/2IBBrbqIBzTdxEUuqSsfs= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Feb 2021 14:48:16 +0900 Message-Id: <20210212054816.53561-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210212054816.53561-1-paul.elder@ideasonboard.com> References: <20210212054816.53561-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 4/4] cam: Default camera location to external 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" Now that we default the camera sensor location to Unknown, handle it in cam the same way external is handled. Signed-off-by: Paul Elder --- New in v2 --- src/cam/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cam/main.cpp b/src/cam/main.cpp index e01be63a..261ed0c8 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -387,6 +387,7 @@ std::string const CamApp::cameraName(const Camera *camera) name = "Internal back camera"; break; case properties::CameraLocationExternal: + case properties::CameraLocationUnknown: name = "External camera"; if (props.contains(properties::Model)) name += " '" + props.get(properties::Model) + "'";