{"id":19263,"url":"https://patchwork.libcamera.org/api/patches/19263/?format=json","web_url":"https://patchwork.libcamera.org/patch/19263/","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":"<20231204001013.404720-2-andrey.konovalov@linaro.org>","date":"2023-12-04T00:10:07","name":"[libcamera-devel,RFC,1/7] libcamera: introduce SoftwareIsp class","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"cf6de5d1bdfe3d185d433ab29f2a2524226089a8","submitter":{"id":25,"url":"https://patchwork.libcamera.org/api/people/25/?format=json","name":"Andrey Konovalov","email":"andrey.konovalov@linaro.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19263/mbox/","series":[{"id":4096,"url":"https://patchwork.libcamera.org/api/series/4096/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4096","date":"2023-12-04T00:10:06","name":"libcamera: introduce Software ISP and Software IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/4096/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19263/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19263/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 26C94C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Dec 2023 00:10:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7837629D2;\n\tMon,  4 Dec 2023 01:10:42 +0100 (CET)","from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D305A629C2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Dec 2023 01:10:40 +0100 (CET)","by mail-wr1-x432.google.com with SMTP id\n\tffacd0b85a97d-33339d843b9so1290077f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 03 Dec 2023 16:10:40 -0800 (PST)","from Lat-5310.. ([87.116.165.212]) by smtp.gmail.com with ESMTPSA\n\tid\n\tu29-20020adfa19d000000b003332db7d91dsm8835997wru.39.2023.12.03.16.10.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSun, 03 Dec 2023 16:10:40 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1701648642;\n\tbh=Hs6qsED+J4nvWplDsdRC9lZLlUivMZkNy1c3J8GcY4s=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=mO1s0Yz5bZDGTNwNa5Lyg5i37hKB1PxQr6L+NquDuWOHhhILqKvFc7eWZ6jms27wU\n\tk87Ba8zcp1cGlAnb0M6BQcHp05e4OZVz3DiAUX/C5023dr1+2OB8GPRl/u7kUuvJH+\n\tYhgJ9pbeFAzf1hIJIO4SqMIE8Kie+ia4qrUUXxEQddSRA/d8x2oy876Yac+ikFJZ+Z\n\t00YgSX5xSOX/khctDoiA6jkCMpGFlkQpg8jJK6NTYEbgtHxN7Sm87vYxlYhKHkyOxh\n\tCKEVMNCfObGd0ncLO68mFRoLIt76LmkoHNvt5jv2wcR3w6FKZBLufbNhPIV9QQJCSQ\n\tTtQ9Q8fcEpM3g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=linaro.org; s=google; t=1701648640; x=1702253440;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Kd7bj0qh+i1DezuNBO0exd5KVwqH+RukxtsQuZTDKZg=;\n\tb=hunj3/mjE2kUUPUYupTWOUTd4LP1YwmCXbwqjnkqIKhEpSky+p3bpRRJw/LNz44pRk\n\tuxbuEtHQyswbXyx1xVBdsOv/iywhmFdaemRd+TquFjWIq+riF0ghflA1rrELZD5x1SkG\n\t016H177zpMDVmkEmLsXancHPG20w3pDo8lewh/cPrwa1eWTY71Ajlvz2loSMaWu8kqQZ\n\tUEZS76YGmppKIb1gz3quxESoiojwWvfT5T1iP1YOkH1HZMlsrOoBgUUnxpRZJrVWGYcY\n\tcegoB6O8yoBdacRoVQKOkkXY1IjeGsYjNCQTTbCtzXorLMLcbP9xsM01gz3fRFw9mFgc\n\tgxuw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=linaro.org\n\theader.i=@linaro.org header.b=\"hunj3/mj\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1701648640; x=1702253440;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Kd7bj0qh+i1DezuNBO0exd5KVwqH+RukxtsQuZTDKZg=;\n\tb=fos1FQDlakfCTVwlx6BaNu/oqgexF2C2UPAfSEHsQOwb7AQ6MR6v9THvkekIxM+XL/\n\t5/XXu6rqdAymK+AVBCEs2b7elvdq3P76CeYmoOU7W3D8qwAxAhIsHU8CI8ToldJpRTLw\n\tfqWB4KuQoVH2pgSeoxPQc1IvjhGxWhw+Drn3z76rPbaIjeX3fO2pN+2cnahIKMj5lcSR\n\tBzTQVVmcnOorSQ1AUhyTJ3QaCFMcKjztkvQCCdaFTWhZIp+4ah/larKkJDFzVC3c+xds\n\tCuv+EhLzVXbU0qYHP9S5OY+jtNTLXVpCE3x3QEi6HSoppYcwbbYi6QvPsCjTmcRXaJrR\n\t+oRw==","X-Gm-Message-State":"AOJu0Yy0ZyEUXX9cBDg4zTxL0o6l2inGEQfwxJ1n5kSBuxDZEvsljcLz\n\tCgaRInGhHh/Vy9LDQRTcDYTQMkyMuAsopxD7g1Q=","X-Google-Smtp-Source":"AGHT+IGe4tUY3HRpL0V+K5xUbo1HhDeMXr/5xzLoA/Zz2NHajHg3dKuKdfzVb6L25kZxaPKQsh4I4A==","X-Received":"by 2002:adf:f4d2:0:b0:333:6ce:4da9 with SMTP id\n\th18-20020adff4d2000000b0033306ce4da9mr2613368wrp.58.1701648640407; \n\tSun, 03 Dec 2023 16:10:40 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon,  4 Dec 2023 03:10:07 +0300","Message-Id":"<20231204001013.404720-2-andrey.konovalov@linaro.org>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20231204001013.404720-1-andrey.konovalov@linaro.org>","References":"<20231204001013.404720-1-andrey.konovalov@linaro.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH 1/7] libcamera: introduce SoftwareIsp\n\tclass","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>","From":"Andrey Konovalov via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Andrey Konovalov <andrey.konovalov@linaro.org>","Cc":"mripard@redhat.com, g.martti@gmail.com, t.langendam@gmail.com,\n\tsrinivas.kandagatla@linaro.org, bryan.odonoghue@linaro.org,\n\tadmin@dennisbonke.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>\n---\n include/libcamera/internal/meson.build    |  1 +\n include/libcamera/internal/software_isp.h | 67 +++++++++++++++++++++++\n src/libcamera/meson.build                 |  1 +\n src/libcamera/software_isp.cpp            | 25 +++++++++\n 4 files changed, 94 insertions(+)\n create mode 100644 include/libcamera/internal/software_isp.h\n create mode 100644 src/libcamera/software_isp.cpp","diff":"diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build\nindex 7f1f3440..0f725cfd 100644\n--- a/include/libcamera/internal/meson.build\n+++ b/include/libcamera/internal/meson.build\n@@ -38,6 +38,7 @@ libcamera_internal_headers = files([\n     'process.h',\n     'pub_key.h',\n     'request.h',\n+    'software_isp.h',\n     'source_paths.h',\n     'sysfs.h',\n     'v4l2_device.h',\ndiff --git a/include/libcamera/internal/software_isp.h b/include/libcamera/internal/software_isp.h\nnew file mode 100644\nindex 00000000..556203d9\n--- /dev/null\n+++ b/include/libcamera/internal/software_isp.h\n@@ -0,0 +1,67 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2023, Linaro Ltd\n+ *\n+ * software_isp.h - Interface for a software implementation of an ISP\n+ */\n+\n+#pragma once\n+\n+#include <functional>\n+#include <initializer_list>\n+#include <map>\n+#include <memory>\n+#include <string>\n+#include <tuple>\n+#include <vector>\n+\n+#include <libcamera/base/class.h>\n+#include <libcamera/base/signal.h>\n+\n+#include <libcamera/geometry.h>\n+\n+namespace libcamera {\n+\n+class FrameBuffer;\n+class PixelFormat;\n+struct StreamConfiguration;\n+\n+class SoftwareIsp\n+{\n+public:\n+\tSoftwareIsp(const std::string &name);\n+\tvirtual ~SoftwareIsp();\n+\n+\tvirtual int loadConfiguration(const std::string &filename) = 0;\n+\n+\tvirtual bool isValid() const = 0;\n+\n+\tvirtual std::vector<PixelFormat> formats(PixelFormat input) = 0;\n+\tvirtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0;\n+\n+\tvirtual std::tuple<unsigned int, unsigned int>\n+\tstrideAndFrameSize(const PixelFormat &pixelFormat, const Size &size) = 0;\n+\n+\tvirtual int configure(const StreamConfiguration &inputCfg,\n+\t\t\t      const std::vector<std::reference_wrapper<StreamConfiguration>> &outputCfgs) = 0;\n+\tvirtual int exportBuffers(unsigned int output, unsigned int count,\n+\t\t\t\t  std::vector<std::unique_ptr<FrameBuffer>> *buffers) = 0;\n+\n+\tvirtual int start() = 0;\n+\tvirtual void stop() = 0;\n+\n+\tvirtual int queueBuffers(FrameBuffer *input,\n+\t\t\t\t const std::map<unsigned int, FrameBuffer *> &outputs) = 0;\n+\n+\tSignal<FrameBuffer *> inputBufferReady;\n+\tSignal<FrameBuffer *> outputBufferReady;\n+\n+\t/* The int parameter isn't actually used */\n+\tSignal<int> ispStatsReady;\n+\n+\tconst std::string &name() const { return name_; }\n+private:\n+\tstd::string name_;\n+};\n+\n+} /* namespace libcamera */\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex d0e26f6b..9d26a87f 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -40,6 +40,7 @@ libcamera_sources = files([\n     'process.cpp',\n     'pub_key.cpp',\n     'request.cpp',\n+    'software_isp.cpp',\n     'source_paths.cpp',\n     'stream.cpp',\n     'sysfs.cpp',\ndiff --git a/src/libcamera/software_isp.cpp b/src/libcamera/software_isp.cpp\nnew file mode 100644\nindex 00000000..3d81c27a\n--- /dev/null\n+++ b/src/libcamera/software_isp.cpp\n@@ -0,0 +1,25 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2023, Linaro Ltd\n+ *\n+ * software_isp.cpp - Interface for a software implementation of an ISP\n+ */\n+\n+#include \"libcamera/internal/software_isp.h\"\n+\n+#include <libcamera/base/log.h>\n+\n+namespace libcamera {\n+\n+LOG_DEFINE_CATEGORY(SoftwareIsp)\n+\n+SoftwareIsp::SoftwareIsp(const std::string &name)\n+\t: name_(name)\n+{\n+}\n+\n+SoftwareIsp::~SoftwareIsp()\n+{\n+}\n+\n+} /* namespace libcamera */\n","prefixes":["libcamera-devel","RFC","1/7"]}