From 892c0f4c19f2d423560a1ab4d7498130816852c3 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Wed, 23 Dec 2020 12:34:42 +0900 Subject: libcamera: control_serializer: Save serialized ControlInfoMap in a cache The ControlSerializer saves all ControlInfoMaps that it has already (de)serialized, in order to (de)serialize ControlLists that contain the ControlInfoMaps. Leverage this to cache ControlInfoMaps, such that the ControlSerializer will not re-(de)serialize a ControlInfoMap that it has previously (de)serialized. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- include/libcamera/internal/control_serializer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/libcamera/internal/control_serializer.h b/include/libcamera/internal/control_serializer.h index 0ab29d9a..7d4426c9 100644 --- a/include/libcamera/internal/control_serializer.h +++ b/include/libcamera/internal/control_serializer.h @@ -33,6 +33,8 @@ public: template T deserialize(ByteStreamBuffer &buffer); + bool isCached(const ControlInfoMap &infoMap); + private: static size_t binarySize(const ControlValue &value); static size_t binarySize(const ControlInfo &info); -- cgit v1.2.1