[libcamera-devel,v3,04/23] libcamera: control_serializer: Support internal controls
diff mbox series

Message ID 20220630133902.321099-5-jacopo@jmondi.org
State New
Headers show
Series
  • Internal controls, sensor delays and IPA rework
Related show

Commit Message

Jacopo Mondi June 30, 2022, 1:38 p.m. UTC
The control serializer class uses tags to identify which ControlIdMap
to use to de-serialize a ControlList.

Add a value for internal controls to the ipa_controls_id_map_type
enumeration and use it to identify lists of internal controls.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 include/libcamera/ipa/ipa_controls.h | 1 +
 src/libcamera/control_serializer.cpp | 6 ++++++
 2 files changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/ipa/ipa_controls.h b/include/libcamera/ipa/ipa_controls.h
index e5da1946ce1d..609e28197f50 100644
--- a/include/libcamera/ipa/ipa_controls.h
+++ b/include/libcamera/ipa/ipa_controls.h
@@ -20,6 +20,7 @@  extern "C" {
 enum ipa_controls_id_map_type {
 	IPA_CONTROL_ID_MAP_CONTROLS,
 	IPA_CONTROL_ID_MAP_PROPERTIES,
+	IPA_CONTROL_ID_MAP_INTERNAL_CONTROLS,
 	IPA_CONTROL_ID_MAP_V4L2,
 };
 
diff --git a/src/libcamera/control_serializer.cpp b/src/libcamera/control_serializer.cpp
index e87d23625ed2..c5b691a981a2 100644
--- a/src/libcamera/control_serializer.cpp
+++ b/src/libcamera/control_serializer.cpp
@@ -21,6 +21,7 @@ 
 #include <libcamera/ipa/ipa_controls.h>
 
 #include "libcamera/internal/byte_stream_buffer.h"
+#include "libcamera/internal/control_ids.h"
 
 /**
  * \file control_serializer.h
@@ -335,6 +336,8 @@  int ControlSerializer::serialize(const ControlList &list,
 		idMapType = IPA_CONTROL_ID_MAP_CONTROLS;
 	else if (idmap == &properties::properties)
 		idMapType = IPA_CONTROL_ID_MAP_PROPERTIES;
+	else if (idmap == &controls::internal::controls)
+		idMapType = IPA_CONTROL_ID_MAP_INTERNAL_CONTROLS;
 	else
 		idMapType = IPA_CONTROL_ID_MAP_V4L2;
 
@@ -461,6 +464,9 @@  ControlInfoMap ControlSerializer::deserialize<ControlInfoMap>(ByteStreamBuffer &
 	case IPA_CONTROL_ID_MAP_PROPERTIES:
 		idMap = &properties::properties;
 		break;
+	case IPA_CONTROL_ID_MAP_INTERNAL_CONTROLS:
+		idMap = &controls::internal::controls;
+		break;
 	case IPA_CONTROL_ID_MAP_V4L2:
 		controlIdMaps_.emplace_back(std::make_unique<ControlIdMap>());
 		localIdMap = controlIdMaps_.back().get();