From patchwork Thu Jun 30 13:38:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16461 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 B22C7C3274 for ; Thu, 30 Jun 2022 13:39:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6770765656; Thu, 30 Jun 2022 15:39:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656596364; bh=zPR0ZoqDhUm2TMeYw2bRw8+KOUOJGkyz5Mn+49FkRO8=; 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=PP1zBMEWQrNXw4ky0CJ6hzIbzXkerKZv7b7ie6syOXsPM5OWhbqcdgRTEj7g1NIMa Pr0x3tIQTrboMz5RTgWWlW/hMPaurWTbvzn0mQchwYKkkbUHcIQO8JZ/5id8LP3Y6g MnyfZChHPstlE+9HWDdpV+cNjsyfmn3xBBaByQnuLnrfO3tbZrFAD/UTs+p72n+/NA 47N7wDHJAEbKWOgvG9p4Lodjo6USeRcYGtZZmdKwcyBuQlPNQ+5dVmk1Ij0SQmGjEb wGxmyduFtjrTRn0fwkXuXT018KwMx/h3d+7xqBAVws8NrY7Jt4Sailq8bdVqaMNBcv SZLdtT6bY6uLg== Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 11ED165633 for ; Thu, 30 Jun 2022 15:39:21 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id 7676F240004; Thu, 30 Jun 2022 13:39:20 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Thu, 30 Jun 2022 15:38:42 +0200 Message-Id: <20220630133902.321099-4-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 03/23] libcamera: Introduce 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" Introduce the enumeration of internal controls in internal_control_ids.yaml. Plumb in the build system the command to generate the definition of internal controls by re-using the same mechanism used for public controls to make it easy to extend it to also handle internal properties in future. Signed-off-by: Jacopo Mondi Reviewed-by: Jean-Michel Hautbois --- include/libcamera/internal/meson.build | 15 ++++++++++++++ src/libcamera/internal_control_ids.yaml | 27 +++++++++++++++++++++++++ src/libcamera/meson.build | 17 ++++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 src/libcamera/internal_control_ids.yaml diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 7a780d48ee57..1559c3c368c4 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -9,6 +9,21 @@ libcamera_tracepoint_header = custom_target( command: [gen_tracepoints_header, '@OUTPUT@', '@INPUT@'], ) +# Generate the list of internal controls identifiers +internal_control_source_files = ['control_ids'] + +libcamera_internal_control_headers = [] + +foreach header : internal_control_source_files + input_files = files('../../../src/libcamera/internal_' + header +'.yaml',\ + '../' + header + '.h.in') + libcamera_internal_control_headers += custom_target( + 'internal_' + header + '_h', + input : input_files, + output : header + '.h', + command : [gen_controls, '--internal=True','-o', '@OUTPUT@', '@INPUT@']) +endforeach + libcamera_internal_headers = files([ 'bayer_format.h', 'byte_stream_buffer.h', diff --git a/src/libcamera/internal_control_ids.yaml b/src/libcamera/internal_control_ids.yaml new file mode 100644 index 000000000000..6d3775afcf67 --- /dev/null +++ b/src/libcamera/internal_control_ids.yaml @@ -0,0 +1,27 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# +# Copyright (C) 2022, Google Inc. +# +%YAML 1.2 +--- +# Enumeration of internal libcamera controls +# Not exposed to application, for library use only + +controls: + + - ExposureTime: + type: int32_t + description: | + The sensor exposure time in milliseconds. + + - FrameDuration: + type: int64_t + description: | + The sensor frame duration time in milliseconds. + + - AnalogueGain: + type: float + description: | + The sensor analogue gain value. + +... diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index b57bee7ef6ca..89fdf347c708 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -52,6 +52,7 @@ libcamera_sources = files([ libcamera_sources += libcamera_public_headers libcamera_sources += libcamera_generated_ipa_headers libcamera_sources += libcamera_tracepoint_header +libcamera_sources += libcamera_internal_control_headers includes = [ libcamera_includes, @@ -99,6 +100,7 @@ if not libyaml.found() libyaml = libyaml_wrap.dependency('yaml') endif +# Generate control_ids.cpp and property_ids.cpp control_sources = [] foreach source : control_source_files @@ -111,6 +113,21 @@ endforeach libcamera_sources += control_sources +# Generate internal_control_ids.cpp +internal_control_source_files = ['control_ids'] +internal_control_sources = [] + +foreach source : internal_control_source_files + input_files = files('internal_' + source +'.yaml', source + '.cpp.in') + internal_control_sources += custom_target('internal_' + source + '_cpp', + input : input_files, + output : 'internal_' + source + '.cpp', + command : [gen_controls, '--internal=True',\ + '-o', '@OUTPUT@',\ + '@INPUT@']) +endforeach +libcamera_sources += internal_control_sources + gen_version = meson.project_source_root() / 'utils' / 'gen-version.sh' # Use vcs_tag() and not configure_file() or run_command(), to ensure that the