From patchwork Mon Feb 15 10:11:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11295 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 28B82BD162 for ; Mon, 15 Feb 2021 10:12:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EACD2637C4; Mon, 15 Feb 2021 11:12:16 +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="QDVwwx+w"; 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 03AF16375F for ; Mon, 15 Feb 2021 11:12:15 +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 987FB743; Mon, 15 Feb 2021 11:12:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613383934; bh=31tnoUZ4J0/jdeQvMwQ2RoWnfPl5feEqhFD72m2mSvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QDVwwx+wpwTS4aWTRSHbkhITfOxAa4Q7JDGPfUAM7jjFVYtS+MumqIWL9qD82Uiq/ nxINW1BIIffGw99VN4S7z7UL7FZNuvCGam+DEqC5jWwZMtjaTkv3vXw5BLQ70FTpq7 nVAqgNaQXqldi3SDMuCH0NrLAiqwKi43D3hFLW1Y= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Feb 2021 19:11:57 +0900 Message-Id: <20210215101200.149457-2-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210215101200.149457-1-paul.elder@ideasonboard.com> References: <20210215101200.149457-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 --- No change in v3 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 Mon Feb 15 10:11:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11296 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 7FC02BD162 for ; Mon, 15 Feb 2021 10:12:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4F2EC637CA; Mon, 15 Feb 2021 11:12:18 +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="o8vXb54R"; 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 7622F6375F for ; Mon, 15 Feb 2021 11:12:17 +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 5EE83743; Mon, 15 Feb 2021 11:12:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613383937; bh=UqTuPPNO01AN4GfNpzdhad2c0tXIJfE/+Gch2eHkhL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8vXb54RMICagkdyFpx+JyZVmrKvVxxspcUoPvL806pUTDOdIJSpuHkyndxHRlOBc zOpTFL3K1hqLJ2TJxNSqGUohD89QycQVSB9KteFPUmlk9pESseWVGAuAc4WmP0mRWc etEyu8GP5RhW8akZSzKJZK8xEueU4LiFKqN4hYnU= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Feb 2021 19:11:58 +0900 Message-Id: <20210215101200.149457-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210215101200.149457-1-paul.elder@ideasonboard.com> References: <20210215101200.149457-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 v3 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 Mon Feb 15 10:11:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11297 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 DC569BD162 for ; Mon, 15 Feb 2021 10:12:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AB216637BF; Mon, 15 Feb 2021 11:12:21 +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="XwnxwPep"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9B6166375F for ; Mon, 15 Feb 2021 11:12:20 +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 E7A0A743; Mon, 15 Feb 2021 11:12:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613383940; bh=Sop2kqB8sDHrMsH4tqyNKwgLSxVC8Yg/QD8dAbMVcJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwnxwPepY2PwpoJv0qoW/sdCE+mwVcPK5Lqnl5t0qSmPGaxsvaIMtIVOXMPr7Uba2 uayQqxPE8jRMJmO60viTkjakARBpY3BUvWPSVH0G87Tbxg0vX3TMEDbvuIIlfv/wNx o2xo6coekbiZOz2jFQEpG5w/MmUkEZ4G90ixiK6U= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Feb 2021 19:11:59 +0900 Message-Id: <20210215101200.149457-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210215101200.149457-1-paul.elder@ideasonboard.com> References: <20210215101200.149457-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 --- Changes in v3: - print warning when defaulting to front from unknown location No change in v2 --- src/android/camera_device.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 1e2a5b5f..a4447c16 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -407,6 +407,11 @@ int CameraDevice::initialize() case properties::CameraLocationExternal: facing_ = CAMERA_FACING_EXTERNAL; break; + case properties::CameraLocationUnknown: + LOG(HAL, Warning) + << "Unknown camera location, defaulting to front"; + facing_ = CAMERA_FACING_FRONT; + break; } } From patchwork Mon Feb 15 10:12:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11298 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 46B17BD162 for ; Mon, 15 Feb 2021 10:12:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 16C2D637C9; Mon, 15 Feb 2021 11:12:24 +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="HDazMhqr"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6D9B86375F for ; Mon, 15 Feb 2021 11:12:22 +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 052A1743; Mon, 15 Feb 2021 11:12:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1613383942; bh=Lepowur9CMGnSW/wO1rxCZCbniYZrEQq0T2N5GikfEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HDazMhqr/ttvuIUSuAE4aq1YiSNmJ1Ct2izi5mvoh7B0SjY5zBiPc/xjvVvzSFG4d WDcbBzZRw29tAQTwvhpJOjbPaz1RqI7Q/px4KIRddxbqjr677zVmTlDorqCDhNf+QU 8ss1+6IDy1dc5S/owoasiRKZIawrp3J7y4DJOvTQ= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Mon, 15 Feb 2021 19:12:00 +0900 Message-Id: <20210215101200.149457-5-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210215101200.149457-1-paul.elder@ideasonboard.com> References: <20210215101200.149457-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 4/4] cam: Print unknown 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" Now that we default the camera sensor location to Unknown, print that the location is unknown in cam. We report the location as unknown instead of defaulting to something else since cam is a test tool. Signed-off-by: Paul Elder --- Changes in v3: - report the location as unknown New in v2 --- src/cam/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cam/main.cpp b/src/cam/main.cpp index e01be63a..14f12e9d 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -379,7 +379,8 @@ std::string const CamApp::cameraName(const Camera *camera) const ControlList &props = camera->properties(); std::string name; - switch (props.get(properties::Location)) { + int location = props.get(properties::Location); + switch (location) { case properties::CameraLocationFront: name = "Internal front camera"; break; @@ -387,7 +388,10 @@ std::string const CamApp::cameraName(const Camera *camera) name = "Internal back camera"; break; case properties::CameraLocationExternal: - name = "External camera"; + case properties::CameraLocationUnknown: + name = location == properties::CameraLocationExternal ? + "External camera" : + "Unknown Location"; if (props.contains(properties::Model)) name += " '" + props.get(properties::Model) + "'"; break;