[libcamera-devel] [RFC 5/7] libcamera: sensor: ov5670: Register pixel array properties

Jacopo Mondi jacopo at jmondi.org
Wed Dec 18 15:49:59 CET 2019


Implement sensor specific pixel array properties initialization for the
OV5670 sensor driver by overriding CameraSensor::initProperties()
method.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/libcamera/sensor/ov5670.cpp | 19 +++++++++++++++++++
 src/libcamera/sensor/ov5670.h   |  3 +++
 2 files changed, 22 insertions(+)

diff --git a/src/libcamera/sensor/ov5670.cpp b/src/libcamera/sensor/ov5670.cpp
index ca9f3c1d544f..c2d996785717 100644
--- a/src/libcamera/sensor/ov5670.cpp
+++ b/src/libcamera/sensor/ov5670.cpp
@@ -6,6 +6,10 @@
  */
 
 #include "ov5670.h"
+
+#include <libcamera/controls.h>
+#include <libcamera/property_ids.h>
+
 #include "camera_sensor.h"
 
 namespace libcamera {
@@ -15,4 +19,19 @@ OV5670CameraSensor::OV5670CameraSensor(const MediaEntity *entity)
 {
 }
 
+int OV5670CameraSensor::initProperties(const ControlInfoMap &controlMap)
+{
+	/* Pixel Array Properties. */
+	properties_.set(properties::PixelArraySize, { 2.9f, 1.18f });
+	properties_.set(properties::PixelArrayBounds, { 2592, 1944 });
+	properties_.set(properties::PixelArrays, { 2592, 1944 });
+	properties_.set(properties::ActiveAreaSize, { 16, 6, 2560, 1920 });
+	int32_t bayerFilter = properties::BayerFilterGRBG;
+	properties_.set(properties::BayerFilterArrangement, bayerFilter);
+	properties_.set(properties::ISOSensitivityRange, { 50, 800 });
+
+	return CameraSensor::initProperties(controlMap);
+}
+
 }; /* namespace libcamera */
+
diff --git a/src/libcamera/sensor/ov5670.h b/src/libcamera/sensor/ov5670.h
index f84239c8411d..564a4546d69b 100644
--- a/src/libcamera/sensor/ov5670.h
+++ b/src/libcamera/sensor/ov5670.h
@@ -11,8 +11,11 @@
 
 namespace libcamera {
 
+class ControlInfoMap;
 class OV5670CameraSensor final : public CameraSensor
 {
+	int initProperties(const ControlInfoMap &controlMap);
+
 private:
 	OV5670CameraSensor(const MediaEntity *entity);
 	friend CameraSensorFactory;
-- 
2.24.0



More information about the libcamera-devel mailing list