From patchwork Thu Jun 30 13:38:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16463 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 553FAC3275 for ; Thu, 30 Jun 2022 13:39:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 941A16565E; Thu, 30 Jun 2022 15:39:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656596367; bh=YRcrjHMXZIwdFvwX6ssq+Ra4PbFZJC596koAMpw3dT8=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=AdfxTYI1rQgEAiHf32vDLfhhaz/IKo07wuWyieilKBMMHb0ar78MAAyzsiEnXiwt4 ENhfcgrTh90EBjI7KGzZxDrnw6JgpkDP1y7Tsxdy2LhD25qRMISEjlFWyVkdFpsblz No2SS78eIp/N1xQZRuyChe+gZ+tuQF3cOgFihMVoPRE/r6fUpfXI1XMKes0Mq2Beys pDB0EdogBtIFaXqFDp6wLDxM9smlaa7aw9efIXlh5tq5Z/LzFkfLmNDEljWahbg9LP AedC+7WpnkMDFLjV/s4ZdR+yNdw/R9f7PeHfYb5VLMnnNRh6E8V7VgN7O4MHeadta4 XrzIfuTj22oWw== Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 12AF565653 for ; Thu, 30 Jun 2022 15:39:22 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 4C327240003; Thu, 30 Jun 2022 13:39:21 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Jun 2022 15:38:43 +0200 Message-Id: <20220630133902.321099-5-jacopo@jmondi.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220630133902.321099-1-jacopo@jmondi.org> References: <20220630133902.321099-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 04/23] libcamera: control_serializer: Support internal controls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 --- include/libcamera/ipa/ipa_controls.h | 1 + src/libcamera/control_serializer.cpp | 6 ++++++ 2 files changed, 7 insertions(+) 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 #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(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()); localIdMap = controlIdMaps_.back().get();