[libcamera-devel,v3,7/7] DNI: libcamera: sensor: ov5670: Add lens properties

Message ID 20200218112752.3910410-8-jacopo@jmondi.org
State Superseded, archived
Delegated to: Jacopo Mondi
Headers show
Series
  • Camera sensor factory
Related show

Commit Message

Jacopo Mondi Feb. 18, 2020, 11:27 a.m. UTC
Register lens properties in the ov5670 sensor handler.

This patch is not intended for merge as we know lens properties do no
belong to the sensor handler, but I am including it anyhow to trigger
discussions on where they would be more appropriately defined.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/sensor/ov5670.cpp | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Patch

diff --git a/src/libcamera/sensor/ov5670.cpp b/src/libcamera/sensor/ov5670.cpp
index c5fdffda7412..5304dac658f4 100644
--- a/src/libcamera/sensor/ov5670.cpp
+++ b/src/libcamera/sensor/ov5670.cpp
@@ -70,6 +70,21 @@  int OV5670::initProperties()
 	properties_.set(properties::ISOSensitivityRange,
 			Span<int32_t>{ isoSensitivities });
 
+	/* Lens Properties. */
+	std::array<float, 1> lensApertures = { 0.0f };
+	properties_.set(properties::LensApertures,
+			Span<float>{ lensApertures });
+
+	std::array<float, 1> lensFocalLengths = { 3.69f };
+	properties_.set(properties::LensFocalLength,
+			Span<float>{ lensFocalLengths });
+
+	std::array<float, 1> lensHyperfocalMinDistance = { 0.0f };
+	properties_.set(properties::LensHyperfocalDistance,
+			Span<float>{ lensHyperfocalMinDistance });
+
+	properties_.set(properties::LensMinimumFocusDistance, 3.69f);
+
 	return CameraSensor::initProperties();
 }