{"id":12793,"url":"https://patchwork.libcamera.org/api/patches/12793/?format=json","web_url":"https://patchwork.libcamera.org/patch/12793/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210702150940.226941-3-naush@raspberrypi.com>","date":"2021-07-02T15:09:34","name":"[libcamera-devel,v3,2/8] ipa: raspberrypi: Add a constructor struct DeviceStatus","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"91301cae3cbf5ccc6a356a22e5feda20f81eb2b2","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12793/mbox/","series":[{"id":2203,"url":"https://patchwork.libcamera.org/api/series/2203/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2203","date":"2021-07-02T15:09:32","name":"Raspberry Pi: Enable imx477 long exposure modes","version":3,"mbox":"https://patchwork.libcamera.org/series/2203/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12793/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12793/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2A6C9BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  2 Jul 2021 15:09:55 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D82E86850D;\n\tFri,  2 Jul 2021 17:09:54 +0200 (CEST)","from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 19872684E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  2 Jul 2021 17:09:52 +0200 (CEST)","by mail-wm1-x329.google.com with SMTP id\n\tl18-20020a1ced120000b029014c1adff1edso9303943wmh.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 02 Jul 2021 08:09:52 -0700 (PDT)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tn4sm3619335wrw.21.2021.07.02.08.09.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 02 Jul 2021 08:09:51 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"biW6m5by\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=OsExjRL2W95T4NHe/EVVkRdhs/8/IaCpdYq657jQA14=;\n\tb=biW6m5byaq+yLS1uPV8QS5MPMK3zVRC6Cljyz0VYIUb9kpR9GFDtlm7Aj0MkZJefEB\n\tLvWv+KzACL9a7gTkhfJHr0KISrNtlYC7XuaOdAqbI7Pq3K91HFQBl8/8BDYvxcFlwNwe\n\tRBzKmD9eUsWT5Ln+eDmF5lITNWfypj/fDJYzlRdFS/kCVXiKF1mShj9iB8TS4jZWcqI1\n\tPq5Irh6ezRMqbzJzfbVIk1qBw6aeWHtb+taJHYalIy7fxIPNiZYwbL4CVH6XgnReD8q5\n\t8eihW6FXDUnr5iRXlIG7hY68Pb0viQQ0f2plNB+frtc05qmz8rag5uRaZRYK4BbakbIA\n\tETvw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=OsExjRL2W95T4NHe/EVVkRdhs/8/IaCpdYq657jQA14=;\n\tb=VqliTKmhcxfnBMxeFrfk6u6g81aMDSq820jtwERNZyOoyleDjW4baom9YUehn0OZE9\n\tgYUMBMgfRe7tnR6Opu7LcqnFBfmiUNMqwClYRIvMR4KIozCilC1Uo6wckdJO1PJQot+r\n\tvmBVN2AlqKGUM4lffTVa/xlOBRPU9g+yPc6ebawfS5R5B/n74+uuzCNpY9eW/vpLXUpb\n\ttV3vwqpoXHRLgNOa+DYHGxn5dDvLHqL6PoryqgzDUUceM6zObib6x5Czh3joNAKKRTzF\n\tR5nrPiOEUxSjqKUBsb57QhR3yh9tzzSR+i/zfeYOI5PFHB0Uk15KJ5gf/hZnGZlJkphN\n\tcq1g==","X-Gm-Message-State":"AOAM533PInJtJqenjr4Hl3xmCYgc0gxhS4J3sCKJF+bHavJCpWZPL2VO\n\tP8/bFIKCLq6dGXW56avLfBLz8B/1dgSVpw==","X-Google-Smtp-Source":"ABdhPJy2jUowg1ANRQ8CFtzSK7/rB50TWC4jeeI9AFQBhNkOZoJ5RvC7xp+e4i75iiWjlTeXxXAJOw==","X-Received":"by 2002:a7b:c214:: with SMTP id\n\tx20mr5853997wmi.171.1625238591627; \n\tFri, 02 Jul 2021 08:09:51 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri,  2 Jul 2021 16:09:34 +0100","Message-Id":"<20210702150940.226941-3-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210702150940.226941-1-naush@raspberrypi.com>","References":"<20210702150940.226941-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 2/8] ipa: raspberrypi: Add a\n\tconstructor struct DeviceStatus","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The constructor sets all fields to 0. This replaces the memset(0) and default\nvalue initialisation usage in the agc and lux controllers respectively.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/device_status.h | 6 ++++++\n src/ipa/raspberrypi/controller/rpi/agc.cpp     | 2 +-\n src/ipa/raspberrypi/controller/rpi/lux.cpp     | 8 +-------\n 3 files changed, 8 insertions(+), 8 deletions(-)","diff":"diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex 733378dbfa27..73df7ce228dd 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -14,6 +14,12 @@\n  */\n \n struct DeviceStatus {\n+\tDeviceStatus()\n+\t\t: shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0),\n+\t\t  lens_position(0.0), aperture(0.0), flash_intensity(0.0)\n+\t{\n+\t}\n+\n \t/* time shutter is open */\n \tlibcamera::utils::Duration shutter_speed;\n \tdouble analogue_gain;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex 6c3a4eb2a04d..393cfacea025 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -172,7 +172,7 @@ Agc::Agc(Controller *controller)\n \t// it's not been calculated yet (i.e. Process hasn't yet run).\n \tmemset(&status_, 0, sizeof(status_));\n \tstatus_.ev = ev_;\n-\tmemset(&last_device_status_, 0, sizeof(last_device_status_));\n+\tlast_device_status_ = {};\n }\n \n char const *Agc::Name() const\ndiff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp\nindex f58d69397e1c..a3ae633b867a 100644\n--- a/src/ipa/raspberrypi/controller/rpi/lux.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp\n@@ -61,13 +61,7 @@ void Lux::Prepare(Metadata *image_metadata)\n void Lux::Process(StatisticsPtr &stats, Metadata *image_metadata)\n {\n \t// set some initial values to shut the compiler up\n-\tDeviceStatus device_status = {\n-\t\t.shutter_speed = 1.0ms,\n-\t\t.analogue_gain = 1.0,\n-\t\t.lens_position = 0.0,\n-\t\t.aperture = 0.0,\n-\t\t.flash_intensity = 0.0\n-\t};\n+\tDeviceStatus device_status;\n \tif (image_metadata->Get(\"device.status\", device_status) == 0) {\n \t\tdouble current_gain = device_status.analogue_gain;\n \t\tdouble current_aperture = device_status.aperture;\n","prefixes":["libcamera-devel","v3","2/8"]}