[libcamera-devel] [PATCH] android: camera_device: Temporary fix sensor properties

Jacopo Mondi jacopo at jmondi.org
Thu Dec 10 18:59:39 CET 2020


The ChromeOS camera service, which is the current main user of the
Android Camera HAL, fails to start if the pixel array properties are
not registered.

As the sensor driver for the Soraka test device have not yet been
updated to report their pixel array properties through the V4L2
selection API, temporary fix the gap by re-establishing the default
properties values removed by commit 1889cdc2e91c ("android: camera_device:
Initialize pixel array properties")

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/android/camera_device.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index e9fb23175d27..8b46e2d1e4ba 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -735,6 +735,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
 		};
 		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,
 					  data.data(), data.size());
+	} else {
+		int32_t data[] = { 2592, 1944 };
+		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE,
+					  data, 2);
 	}
 
 	if (properties.contains(properties::PixelArrayActiveAreas)) {
@@ -748,6 +752,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
 		};
 		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
 					  data.data(), data.size());
+	} else {
+		int32_t data[] = { 0, 0, 2560, 1920 };
+		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
+					  data, 4);
 	}
 
 	int32_t sensitivityRange[] = {
-- 
2.29.2



More information about the libcamera-devel mailing list