From patchwork Mon Dec 4 00:10:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 19263 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 26C94C3226 for ; Mon, 4 Dec 2023 00:10:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C7837629D2; Mon, 4 Dec 2023 01:10:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1701648642; bh=Hs6qsED+J4nvWplDsdRC9lZLlUivMZkNy1c3J8GcY4s=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=mO1s0Yz5bZDGTNwNa5Lyg5i37hKB1PxQr6L+NquDuWOHhhILqKvFc7eWZ6jms27wU k87Ba8zcp1cGlAnb0M6BQcHp05e4OZVz3DiAUX/C5023dr1+2OB8GPRl/u7kUuvJH+ YhgJ9pbeFAzf1hIJIO4SqMIE8Kie+ia4qrUUXxEQddSRA/d8x2oy876Yac+ikFJZ+Z 00YgSX5xSOX/khctDoiA6jkCMpGFlkQpg8jJK6NTYEbgtHxN7Sm87vYxlYhKHkyOxh CKEVMNCfObGd0ncLO68mFRoLIt76LmkoHNvt5jv2wcR3w6FKZBLufbNhPIV9QQJCSQ TtQ9Q8fcEpM3g== Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D305A629C2 for ; Mon, 4 Dec 2023 01:10:40 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hunj3/mj"; dkim-atps=neutral Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-33339d843b9so1290077f8f.0 for ; Sun, 03 Dec 2023 16:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701648640; x=1702253440; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Kd7bj0qh+i1DezuNBO0exd5KVwqH+RukxtsQuZTDKZg=; b=hunj3/mjE2kUUPUYupTWOUTd4LP1YwmCXbwqjnkqIKhEpSky+p3bpRRJw/LNz44pRk uxbuEtHQyswbXyx1xVBdsOv/iywhmFdaemRd+TquFjWIq+riF0ghflA1rrELZD5x1SkG 016H177zpMDVmkEmLsXancHPG20w3pDo8lewh/cPrwa1eWTY71Ajlvz2loSMaWu8kqQZ UEZS76YGmppKIb1gz3quxESoiojwWvfT5T1iP1YOkH1HZMlsrOoBgUUnxpRZJrVWGYcY cegoB6O8yoBdacRoVQKOkkXY1IjeGsYjNCQTTbCtzXorLMLcbP9xsM01gz3fRFw9mFgc gxuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701648640; x=1702253440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Kd7bj0qh+i1DezuNBO0exd5KVwqH+RukxtsQuZTDKZg=; b=fos1FQDlakfCTVwlx6BaNu/oqgexF2C2UPAfSEHsQOwb7AQ6MR6v9THvkekIxM+XL/ 5/XXu6rqdAymK+AVBCEs2b7elvdq3P76CeYmoOU7W3D8qwAxAhIsHU8CI8ToldJpRTLw fqWB4KuQoVH2pgSeoxPQc1IvjhGxWhw+Drn3z76rPbaIjeX3fO2pN+2cnahIKMj5lcSR BzTQVVmcnOorSQ1AUhyTJ3QaCFMcKjztkvQCCdaFTWhZIp+4ah/larKkJDFzVC3c+xds Cuv+EhLzVXbU0qYHP9S5OY+jtNTLXVpCE3x3QEi6HSoppYcwbbYi6QvPsCjTmcRXaJrR +oRw== X-Gm-Message-State: AOJu0Yy0ZyEUXX9cBDg4zTxL0o6l2inGEQfwxJ1n5kSBuxDZEvsljcLz CgaRInGhHh/Vy9LDQRTcDYTQMkyMuAsopxD7g1Q= X-Google-Smtp-Source: AGHT+IGe4tUY3HRpL0V+K5xUbo1HhDeMXr/5xzLoA/Zz2NHajHg3dKuKdfzVb6L25kZxaPKQsh4I4A== X-Received: by 2002:adf:f4d2:0:b0:333:6ce:4da9 with SMTP id h18-20020adff4d2000000b0033306ce4da9mr2613368wrp.58.1701648640407; Sun, 03 Dec 2023 16:10:40 -0800 (PST) Received: from Lat-5310.. ([87.116.165.212]) by smtp.gmail.com with ESMTPSA id u29-20020adfa19d000000b003332db7d91dsm8835997wru.39.2023.12.03.16.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 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 Subject: [libcamera-devel] [RFC PATCH 1/7] libcamera: introduce SoftwareIsp class 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: Andrey Konovalov via libcamera-devel From: Andrey Konovalov Reply-To: Andrey Konovalov Cc: mripard@redhat.com, g.martti@gmail.com, t.langendam@gmail.com, srinivas.kandagatla@linaro.org, bryan.odonoghue@linaro.org, admin@dennisbonke.com Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Signed-off-by: Andrey Konovalov --- include/libcamera/internal/meson.build | 1 + include/libcamera/internal/software_isp.h | 67 +++++++++++++++++++++++ src/libcamera/meson.build | 1 + src/libcamera/software_isp.cpp | 25 +++++++++ 4 files changed, 94 insertions(+) create mode 100644 include/libcamera/internal/software_isp.h create mode 100644 src/libcamera/software_isp.cpp diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 7f1f3440..0f725cfd 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -38,6 +38,7 @@ libcamera_internal_headers = files([ 'process.h', 'pub_key.h', 'request.h', + 'software_isp.h', 'source_paths.h', 'sysfs.h', 'v4l2_device.h', diff --git a/include/libcamera/internal/software_isp.h b/include/libcamera/internal/software_isp.h new file mode 100644 index 00000000..556203d9 --- /dev/null +++ b/include/libcamera/internal/software_isp.h @@ -0,0 +1,67 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2023, Linaro Ltd + * + * software_isp.h - Interface for a software implementation of an ISP + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +namespace libcamera { + +class FrameBuffer; +class PixelFormat; +struct StreamConfiguration; + +class SoftwareIsp +{ +public: + SoftwareIsp(const std::string &name); + virtual ~SoftwareIsp(); + + virtual int loadConfiguration(const std::string &filename) = 0; + + virtual bool isValid() const = 0; + + virtual std::vector formats(PixelFormat input) = 0; + virtual SizeRange sizes(PixelFormat inputFormat, const Size &inputSize) = 0; + + virtual std::tuple + strideAndFrameSize(const PixelFormat &pixelFormat, const Size &size) = 0; + + virtual int configure(const StreamConfiguration &inputCfg, + const std::vector> &outputCfgs) = 0; + virtual int exportBuffers(unsigned int output, unsigned int count, + std::vector> *buffers) = 0; + + virtual int start() = 0; + virtual void stop() = 0; + + virtual int queueBuffers(FrameBuffer *input, + const std::map &outputs) = 0; + + Signal inputBufferReady; + Signal outputBufferReady; + + /* The int parameter isn't actually used */ + Signal ispStatsReady; + + const std::string &name() const { return name_; } +private: + std::string name_; +}; + +} /* namespace libcamera */ diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index d0e26f6b..9d26a87f 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -40,6 +40,7 @@ libcamera_sources = files([ 'process.cpp', 'pub_key.cpp', 'request.cpp', + 'software_isp.cpp', 'source_paths.cpp', 'stream.cpp', 'sysfs.cpp', diff --git a/src/libcamera/software_isp.cpp b/src/libcamera/software_isp.cpp new file mode 100644 index 00000000..3d81c27a --- /dev/null +++ b/src/libcamera/software_isp.cpp @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2023, Linaro Ltd + * + * software_isp.cpp - Interface for a software implementation of an ISP + */ + +#include "libcamera/internal/software_isp.h" + +#include + +namespace libcamera { + +LOG_DEFINE_CATEGORY(SoftwareIsp) + +SoftwareIsp::SoftwareIsp(const std::string &name) + : name_(name) +{ +} + +SoftwareIsp::~SoftwareIsp() +{ +} + +} /* namespace libcamera */