From patchwork Sun Aug 21 12:43:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Rauch X-Patchwork-Id: 17183 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 E4237BE173 for ; Sun, 21 Aug 2022 12:43:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 050D961FC2; Sun, 21 Aug 2022 14:43:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661085828; bh=+tjUIMzXbvgeuJV1Tdn9soBvfDWaqJWL5l8LabZxWuY=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=a4me6kOlIw1rKzNsMyD5pbVyvPHHQAPLl89PNtXFCMRtKnNzdMFt6TTqB2cbOrFax tGakb0d1RXZrWsuSWCJ+PT+ekUrRTyvE4Azcthmb17b4kEOzntrCbY3pceZjf1xBWE emp/TyT/Hcw6fKf+/hJgO4EjrDLB/M2N7EBmLSuJzmrYcB/iIrxJquTkbT+52h/lFV dDnobik9eusm1RIkR0Cr4xA/CAtm9wGyS5Bvs3K04J4ZEKmglzrusa4Qnke1bAhA7b QiESwae8G3sN6m6R9uoSOswJTZCBJAOEieFujwED3edM8vq/izcqV060EXkbzkatb0 XcTBcb8soYnUg== Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4773C61FA3 for ; Sun, 21 Aug 2022 14:43:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=gmx.net header.i=@gmx.net header.b="CeDLgsfR"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661085825; bh=+tjUIMzXbvgeuJV1Tdn9soBvfDWaqJWL5l8LabZxWuY=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=CeDLgsfRj05N9mtkna0OWSKlSgoIFPIzydCP4nOHOA/9HmQrNk3VmeDtS03WlNs0P izUjLkW0Fgg8wwD1onXib//mEL7fa98QbWyHlw4QVI4C2BYVGBQCEGcufK1BjHUoo3 ndZMqhMA7eqgIw6g+elTyUv1fuUU6DiszIJ45Fr8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from voyager ([88.152.184.103]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MdefJ-1ozMAa2oJl-00Zc5v; Sun, 21 Aug 2022 14:43:45 +0200 To: libcamera-devel@lists.libcamera.org Date: Sun, 21 Aug 2022 14:43:42 +0200 Message-Id: <20220821124343.487963-1-Rauch.Christian@gmx.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:7QJ1y+WyI6ZiG8d6ZeLcEln7mXc6NPQAGwLFo+Z6ZgUVJWX72gV Q9cSKN/w6B7rMbZ77r9cWJWoEwaU9vkiE/zj5BVdZyHb/chaWwcYEKIFAzShT2aPJdz/5ll M2o3HZLY8EGYIzAqj1dXn2MPvbVyxZCzITYSSkteaEUrbPXr2ZNniWlgFbTqEsfhmvtL3RU 3ptzkQNzRJJMp6LoShokA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:a1Ous8fGPXo=:e9EVw2L9TU3UWkTq3o1ukH duVDtOfGIHoKiWXtGeLTImChO/+kis/9WGDiYZaHapq4zmkNdIIBkQi27yunwxpGR3ZGCwfQz MT5PBJ/1pHrG+UYMWzhsP1roszwhIyz1SeYzJ4cSFe0/uOenUvgflF/dOMWIKzZNMQ4DZcWf2 T3Hm101OaYY5IwCCFKorcTSuER/lSetm2us7ZdHQCaSInTXqXO4Qj32zn41Jfo7y6EPL6CO24 1wWm2iRvjXMHEK/+DOfZkzdKqEihb4/J/DRoNkDq6pcIRQ0xICRY8RPZIkaI8w1KnBjEglVXj Jpqj4P7eg/OXRYM35hYYmPiD7aGIz2P6dUlcP5q3sLs3uRhAzAa/kmIdP6H3R87qxNDWLMFKI 4s9QL+DyOpn/RB9NQfvFzwpO/4Fj9qWCD2nD6lt1H8lQ00DoR5JRiRdahCfp2+5X9zdxMpkcy zf5rgguI2cDhdmq9b5iQUQLpkTd3pI/0VQveY6DZynYFXuUdHRCGc+FTbkkSsiYdS35gXSWgZ DLLuE534NLWO48f21Lr7sSP2YG5fR9HwNUK1KmXEGEQeiO53sVpagJE7HYtzWMjpI3UczWR9v oicZx6gyl13uANfz3uTePCP0Sjq4X/2tuW2of6myJYtn4Lmpt6nsAa9/Kzd1nnDToC7nHP8Vr lVZura++uUZANs8deR9tfB42yLg70dwenbFAanmhVUR5CIqE3lkiOy0rlhdonPT8sARh7K6+D IA4tgiiHbA36mlMU+vbUKGdDwKGcP+0Bu1dyM3YQP/KD/mmgnaUO5/0jKlSP3bLj3PlrZO2cn EtovU+RdM0Z0t3se5JAtzsOVwK6J7FHgC5dwUOXNHmE3dWJE8T0KK79N+U7YHLl3k+VjSfJKL AbDOVHvOUO26sl2sB4Tl7DdG8zT7p8sin/k30VgwWGkg+mYB63J+5BlfyTuAxF7QOJsq8QD/z QbhSYOUct1/GCHnDhKc5wGeEAyZl7xQ6AJEdXoqbUK2PjwgqhKLPlXZuPmgPWyJ0YuTG6MOwZ Q5V8EyxaS2fUz7KDSLXd1lrXDlkh0kq14ndqpyLtxPIVbifZ5K4OZfjnWZnhhUF+5HD2vykCb /+borQY5gkEBr6alRHTSVFtIpKFUZtVQ/1NHn0uo74p3+Z04MNsQwtNhg== Subject: [libcamera-devel] [PATCH 1/2] libcamera: control: define an explicit default ControlInfo constructor 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: Christian Rauch via libcamera-devel From: Christian Rauch Reply-To: Christian Rauch Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The default ControlInfo constructor allowed to partially initialised the min/max/def values. Add an explicit default constructor in order to enforce that either all or none of the min/max/def values are defined. Signed-off-by: Christian Rauch --- include/libcamera/controls.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.34.1 diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index ebc168fc..214ad7f3 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -268,9 +268,10 @@ private: class ControlInfo { public: - explicit ControlInfo(const ControlValue &min = 0, - const ControlValue &max = 0, - const ControlValue &def = 0); + explicit ControlInfo() = default; + explicit ControlInfo(const ControlValue &min, + const ControlValue &max, + const ControlValue &def); explicit ControlInfo(Span values, const ControlValue &def = {}); explicit ControlInfo(std::set values, bool def); From patchwork Sun Aug 21 12:43:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Rauch X-Patchwork-Id: 17184 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 7F747BE173 for ; Sun, 21 Aug 2022 12:43:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1427861FC4; Sun, 21 Aug 2022 14:43:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1661085829; bh=Vsd6wIo1QPrXgKL+ivKYCtVASuSr8DT/6GqRY8GQ3Hw=; 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=amBAiGwLxeIpc11CsuSYuLkJPRGu5uvxDmcyA8PgzYB7zSIaiNKQNklYSaaxOHJj3 B7RKJOzFMc6iQRD8JasyNIY61c+TbRRTXuQbHIkA/yU+59URcE8pwj2MJrolR5ZxmS Ulyi1kSmnTiys7Ak7ED5aq2Y7uCHsr/JgTnfl5NHWvps3CtMoc6d0zUar7D2BIDgZ1 RFrDLjt3IRn0xbUzvam2g8j+vFieg4GGh7dSeYQI9T/qCV2m3KL6OcZwlizZrFudoA 1NxKXRdt1n77oa3fGNeqN7kUwiCpTGU5/+NzJPSBwW/lPBpPvh8/gSAadlJSGwSpEw 1ljaNLPzCsMkA== Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5D60A61FA6 for ; Sun, 21 Aug 2022 14:43:46 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=gmx.net header.i=@gmx.net header.b="flGzU8rU"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1661085826; bh=Vsd6wIo1QPrXgKL+ivKYCtVASuSr8DT/6GqRY8GQ3Hw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=flGzU8rUJ9Yk2AYcLOvK2hmdAEu9S6Rf4Ts4U1fh48TLs1f8LWOq0i5qFN78Bs/Nc JYJ4xzjvhmNXV/Vc062nZ2q2cNZbAJ56N+3LKcf4OmSkwF70tNKfcLB9B9mgIqopb8 FuJb/uBHcIRwieYReSMRdmm6ZJYZXZH7Pd4q5yUU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from voyager ([88.152.184.103]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MiJVG-1p43PD3M9e-00fPFw; Sun, 21 Aug 2022 14:43:45 +0200 To: libcamera-devel@lists.libcamera.org Date: Sun, 21 Aug 2022 14:43:43 +0200 Message-Id: <20220821124343.487963-2-Rauch.Christian@gmx.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220821124343.487963-1-Rauch.Christian@gmx.de> References: <20220821124343.487963-1-Rauch.Christian@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:YD7B+uMeFcyWKpd7Us454RGGgqxbtaZg1MGRLfu5Ct7iEu2OgRz t3ZNlQ2aHBrX+2XgGuCIjYQKSRZAEpZrmGlIDPr86ROHn/DGZOqFcK5MBFoiH48IDdLjVMq jsvQvcESQISBAMQ2x/4GCUwGNUboUeOICR9+5ilZ1xnpZeQM1MhcqyaThjRM7N4lBIWarAG c2v4fERixCO42JWUXCp3w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:xHlcTheobb8=:s/gXICFkRSOPoUJW+wY6SK nyv0QdhbqArNRv+fkFks2RKTs2IcAvWB16BKSjQdeCxn0SzKzRxNqh01DuCsd1s9bWfA8pLcw /FlOZV3uNNupNVRw9ZjeQb0A+YJxPPYZzKWcyjFzbIVj0xz3x205vd/yYAhpHIGCEOEAMCLgF JvHVrRPP8YiW518aV5IihmAenZRfMyy/0xMvZ9CA1M6AnrVocsLsheINGT1W5VEcl9O1eKYQM aDBaBrG4/zkl80qxpIX/vvLdM9jD4GlVgF2E/jwIf0D1F0QjHF7CYJPzO7JKm9aGYMbc0fKcz dOJ882XJ6kWXojbX1z8+ovtpFgUWcVXd4+l0XVWnmL5xdJGvRMM+tRMYC/KO5edSzEItFBnBS +MA/wYB06rRvV9MKGL5CR05pdrm4YyID+6F1oIhwresBdsm5K1Dq2/Fobzd4zO6irPYZaqYia j0Xuv3PKg0e/vEMjY4CEs6VhpSSnZZpU8govh9lFgwuhor6XaqXU18tDuc5dh1NKO67jygrEx tsJnJgH9cov8EDqilHcVtMoSa89IETAxF50WhmkXeddbLRpV0HJfv8/3LB0J82SUntwBOJgeW iTo+g3DUASucUtViv3hPtHtn33vF8biKYRAdvhhHOxlnUPCdeO8Dw2DeOjPpNyesTQdJ0BGa6 10QeEocGFTEYSBGYTtDPQF/PzvuhskHlh/ljO8po0frZybXKGZfhtNUnIHiW+WFnFWoqyBCM6 Kd+sb7RQPFClfEF9RpBKFS6GIboY2IdOWjUX/AWxYFLUsbkzRLpSPbUHVPYD+m6jw9DTn8y/L Rh0dlwwRXEABd/Mgq+zaN71+bB3zy97kMBgf4aVzhM1/n6f1+YI/tfap765Np+TzDviqZkQ41 kVzdG3jYISncvJRn6p2fMzyjgAoj93liyLi2XvxS+q3uaG/wJ6b0WQrxHZ2CdvNAMAsQttIhC 6Vmc+8RN0eQd2Hf2GLR7fsW8w9mH1NVkWbly1blI0mKdsRgCyDzS+kh+L5Et6JQoVJVYgTjTv V1e/I+gtSLWSW57qn7jMNTRBUQ85fScxKj70XXTCuaI6ct1cdQoQJlbl0QWM0DLW8HoiNaWNc 1a39VvrbNoJtfRIPicEOMZ04Y165LE7sGKQWsXGt5IFYnnYvUigY/ApHQ== Subject: [libcamera-devel] [PATCH 2/2] libcamera: control: explicitly define default control values 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: Christian Rauch via libcamera-devel From: Christian Rauch Reply-To: Christian Rauch Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Explicitly set the default value for all ControlInfo to 0, false or minimum. Signed-off-by: Christian Rauch --- src/ipa/raspberrypi/raspberrypi.cpp | 22 ++++++++++--------- src/ipa/rkisp1/rkisp1.cpp | 10 ++++----- src/libcamera/pipeline/ipu3/ipu3.cpp | 2 +- .../pipeline/raspberrypi/raspberrypi.cpp | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) -- 2.34.1 diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 69c73f8c..c6360a51 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -74,23 +74,23 @@ constexpr Duration controllerMinFrameDuration = 1.0s / 30.0; /* List of controls handled by the Raspberry Pi IPA */ static const ControlInfoMap::Map ipaControls{ - { &controls::AeEnable, ControlInfo(false, true) }, - { &controls::ExposureTime, ControlInfo(0, 66666) }, - { &controls::AnalogueGain, ControlInfo(1.0f, 16.0f) }, + { &controls::AeEnable, ControlInfo(false, true, false) }, + { &controls::ExposureTime, ControlInfo(0, 66666, 0) }, + { &controls::AnalogueGain, ControlInfo(1.0f, 16.0f, 0.0f) }, { &controls::AeMeteringMode, ControlInfo(controls::AeMeteringModeValues) }, { &controls::AeConstraintMode, ControlInfo(controls::AeConstraintModeValues) }, { &controls::AeExposureMode, ControlInfo(controls::AeExposureModeValues) }, { &controls::ExposureValue, ControlInfo(-8.0f, 8.0f, 0.0f) }, - { &controls::AwbEnable, ControlInfo(false, true) }, - { &controls::ColourGains, ControlInfo(0.0f, 32.0f) }, + { &controls::AwbEnable, ControlInfo(false, true, false) }, + { &controls::ColourGains, ControlInfo(0.0f, 32.0f, 0.0f) }, { &controls::AwbMode, ControlInfo(controls::AwbModeValues) }, { &controls::Brightness, ControlInfo(-1.0f, 1.0f, 0.0f) }, { &controls::Contrast, ControlInfo(0.0f, 32.0f, 1.0f) }, { &controls::Saturation, ControlInfo(0.0f, 32.0f, 1.0f) }, { &controls::Sharpness, ControlInfo(0.0f, 16.0f, 1.0f) }, - { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f) }, + { &controls::ColourCorrectionMatrix, ControlInfo(-16.0f, 16.0f, 0.0f) }, { &controls::ScalerCrop, ControlInfo(Rectangle{}, Rectangle(65535, 65535, 65535, 65535), Rectangle{}) }, - { &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000)) }, + { &controls::FrameDurationLimits, ControlInfo(INT64_C(33333), INT64_C(120000), INT64_C(0)) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) } }; @@ -463,10 +463,11 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, const Duration maxSensorFrameDuration = mode_.maxFrameLength * mode_.lineLength; ctrlMap[&controls::FrameDurationLimits] = ControlInfo(static_cast(minSensorFrameDuration.get()), - static_cast(maxSensorFrameDuration.get())); + static_cast(maxSensorFrameDuration.get()), + int64_t(0)); ctrlMap[&controls::AnalogueGain] = - ControlInfo(1.0f, static_cast(helper_->gain(maxSensorGainCode_))); + ControlInfo(1.0f, static_cast(helper_->gain(maxSensorGainCode_)), 0.0f); /* * Calculate the max exposure limit from the frame duration limit as V4L2 @@ -478,7 +479,8 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, ctrlMap[&controls::ExposureTime] = ControlInfo(static_cast(helper_->exposure(exposureMin).get()), - static_cast(maxShutter.get())); + static_cast(maxShutter.get()), + int32_t(0)); result->controlInfo = ControlInfoMap(std::move(ctrlMap), controls::controls); return 0; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 27b4212b..2121bfd2 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -91,12 +91,12 @@ namespace { /* List of controls handled by the RkISP1 IPA */ const ControlInfoMap::Map rkisp1Controls{ - { &controls::AeEnable, ControlInfo(false, true) }, - { &controls::AwbEnable, ControlInfo(false, true) }, + { &controls::AeEnable, ControlInfo(false, true, false) }, + { &controls::AwbEnable, ControlInfo(false, true, false) }, { &controls::ColourGains, ControlInfo(0.0f, 3.996f, 1.0f) }, - { &controls::Brightness, ControlInfo(-1.0f, 0.993f) }, - { &controls::Contrast, ControlInfo(0.0f, 1.993f) }, - { &controls::Saturation, ControlInfo(0.0f, 1.993f) }, + { &controls::Brightness, ControlInfo(-1.0f, 0.993f, 0.0f) }, + { &controls::Contrast, ControlInfo(0.0f, 1.993f, 0.0f) }, + { &controls::Saturation, ControlInfo(0.0f, 1.993f, 0.0f) }, { &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, }; diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 9df24603..a1bcfe49 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -42,7 +42,7 @@ namespace libcamera { LOG_DEFINE_CATEGORY(IPU3) static const ControlInfoMap::Map IPU3Controls = { - { &controls::draft::PipelineDepth, ControlInfo(2, 3) }, + { &controls::draft::PipelineDepth, ControlInfo(2, 3, 0) }, }; class IPU3CameraData : public Camera::Private diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index e895584d..8fd7634d 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -954,7 +954,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) /* Add the ScalerCrop control limits based on the current mode. */ Rectangle ispMinCrop(data->ispMinCropSize_); ispMinCrop.scaleBy(data->sensorInfo_.analogCrop.size(), data->sensorInfo_.outputSize); - ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size())); + ctrlMap[&controls::ScalerCrop] = ControlInfo(ispMinCrop, Rectangle(data->sensorInfo_.analogCrop.size()), ispMinCrop); data->controlInfo_ = ControlInfoMap(std::move(ctrlMap), result.controlInfo.idmap());