[libcamera-devel] [PATCH v3 4/4] android: camera_device: Align style of active area size

Jacopo Mondi jacopo at jmondi.org
Mon Dec 28 17:52:03 CET 2020


Align the style of ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE property
registration with the one of the other sensor related properties.

Cosmetic change only, no functional changes intended.

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

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 9ad417ee6c3a..b48c7b7c9d2b 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -883,26 +883,25 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
 	staticMetadata_->addEntry(ANDROID_SENSOR_INFO_PHYSICAL_SIZE,
 				  physicalSize.data(), physicalSize.size());
 
+	std::vector<int32_t> activeAreaSize(4);
 	if (properties.contains(properties::PixelArrayActiveAreas)) {
 		const Span<const Rectangle> &rects =
 			properties.get(properties::PixelArrayActiveAreas);
-		std::vector<int32_t> data{
+		activeAreaSize = {
 			static_cast<int32_t>(rects[0].x),
 			static_cast<int32_t>(rects[0].y),
 			static_cast<int32_t>(rects[0].width),
 			static_cast<int32_t>(rects[0].height),
 		};
-		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
-					  data.data(), data.size());
 	} else {
 		/*
 		 * \todo Drop the default once the ov5670 and ov13858 drivers
 		 * are updated to report the pixel array size.
 		 */
-		int32_t data[] = { 0, 0, 2560, 1920 };
-		staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
-					  data, 4);
+		activeAreaSize = { 0, 0, 2560, 1920 };
 	}
+	staticMetadata_->addEntry(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE,
+				  activeAreaSize.data(), 4);
 
 	int32_t sensitivityRange[] = {
 		32, 2400,
-- 
2.29.2



More information about the libcamera-devel mailing list