[libcamera-devel] [PATCH 1/3] libcamera: control_ids: Introduce LensShadingEnable

Jacopo Mondi jacopo.mondi at ideasonboard.com
Wed Mar 8 17:40:26 CET 2023


From: Jacopo Mondi <jacopo at jmondi.org>

Introduce a control to enable and disable LSC and replace the
draft android control. The control is used to report the algorithm
current state when part of a completed Request metadata.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/android/camera_capabilities.cpp |  4 ++--
 src/libcamera/control_ids.yaml      | 20 ++++++--------------
 2 files changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
index 1bfeaea4b121..040ad7347773 100644
--- a/src/android/camera_capabilities.cpp
+++ b/src/android/camera_capabilities.cpp
@@ -1187,10 +1187,10 @@ int CameraCapabilities::initializeStaticMetadata()
 	{
 		std::vector<uint8_t> data;
 		data.reserve(2);
-		const auto &infoMap = controlsInfo.find(&controls::draft::LensShadingMapMode);
+		const auto &infoMap = controlsInfo.find(&controls::LensShadingEnable);
 		if (infoMap != controlsInfo.end()) {
 			for (const auto &value : infoMap->second.values())
-				data.push_back(value.get<int32_t>());
+				data.push_back(value.get<bool>());
 		} else {
 			data.push_back(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);
 		}
diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml
index adea5f90acc5..9457fb3de7b0 100644
--- a/src/libcamera/control_ids.yaml
+++ b/src/libcamera/control_ids.yaml
@@ -694,6 +694,12 @@ controls:
             Continuous AF is paused. No further state changes or lens movements
             will occur until the AfPauseResume control is sent.
 
+  - LensShadingEnable:
+      type: bool
+      description: |
+        Enable or disable the lens shading algorithm. When reported in the
+        Request metadata the control reflects the algorithm's current state.
+
   # ----------------------------------------------------------------------------
   # Draft controls section
 
@@ -829,20 +835,6 @@ controls:
        row and the start of exposure of the last row. Currently identical to
        ANDROID_SENSOR_ROLLING_SHUTTER_SKEW
 
-  - LensShadingMapMode:
-      type: int32_t
-      draft: true
-      description: |
-       Control to report if the lens shading map is available. Currently
-       identical to ANDROID_STATISTICS_LENS_SHADING_MAP_MODE.
-      enum:
-        - name: LensShadingMapModeOff
-          value: 0
-          description: No lens shading map mode is available.
-        - name: LensShadingMapModeOn
-          value: 1
-          description: The lens shading map mode is available.
-
   - SceneFlicker:
       type: int32_t
       draft: true
-- 
2.39.0



More information about the libcamera-devel mailing list