From patchwork Thu Feb 6 14:10:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 22743 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 827D6C32EA for ; Thu, 6 Feb 2025 14:10:31 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 301DD685EA; Thu, 6 Feb 2025 15:10:31 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="noLBplBo"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 21AA2685E9 for ; Thu, 6 Feb 2025 15:10:28 +0100 (CET) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:6b7d:6f52:efbb:46c8]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8CEBF1193; Thu, 6 Feb 2025 15:09:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1738850954; bh=+FW104UwTZQHeTfkauhTqhUeQSQHwC3w8z/tDG1PYYk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=noLBplBoEIU4GTigrYZPLo6a4SVCdLqEuaRt7XQzRNWY+6lL0B/u5Mtf8i4157nlP CbBxxUesRXjg9ljOuet9G0nsGn84G0dHhrHneGHlbQ4WWPYCeYUzZZkJOD/EL+Pq8C D5Ye4oFOqijIXW/rU4Z8Y6uWnJwsl3fMtHS4kXXk= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH 2/4] libcamera: Adapt Vector class to new location Date: Thu, 6 Feb 2025 15:10:09 +0100 Message-ID: <20250206141018.236272-3-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250206141018.236272-1-stefan.klug@ideasonboard.com> References: <20250206141018.236272-1-stefan.klug@ideasonboard.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Change the namespace of the Vector class from libipa to libcamera and add it to the build. Signed-off-by: Stefan Klug Reviewed-by: Kieran Bingham --- include/libcamera/internal/meson.build | 1 + include/libcamera/internal/vector.h | 14 +++++--------- src/libcamera/meson.build | 1 + src/libcamera/vector.cpp | 6 +----- test/meson.build | 1 + test/vector.cpp | 4 ++-- 6 files changed, 11 insertions(+), 16 deletions(-) diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 7d6aa8b72bd7..45408b313848 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -43,6 +43,7 @@ libcamera_internal_headers = files([ 'v4l2_pixelformat.h', 'v4l2_subdevice.h', 'v4l2_videodevice.h', + 'vector.h', 'yaml_parser.h', ]) diff --git a/include/libcamera/internal/vector.h b/include/libcamera/internal/vector.h index fe33c9d6fbd1..a67a09474204 100644 --- a/include/libcamera/internal/vector.h +++ b/include/libcamera/internal/vector.h @@ -24,8 +24,6 @@ namespace libcamera { LOG_DECLARE_CATEGORY(Vector) -namespace ipa { - #ifndef __DOXYGEN__ template> * = nullptr> @@ -329,11 +327,9 @@ bool operator!=(const Vector &lhs, const Vector &rhs) bool vectorValidateYaml(const YamlObject &obj, unsigned int size); #endif /* __DOXYGEN__ */ -} /* namespace ipa */ - #ifndef __DOXYGEN__ template -std::ostream &operator<<(std::ostream &out, const ipa::Vector &v) +std::ostream &operator<<(std::ostream &out, const Vector &v) { out << "Vector { "; for (unsigned int i = 0; i < Rows; i++) { @@ -346,13 +342,13 @@ std::ostream &operator<<(std::ostream &out, const ipa::Vector &v) } template -struct YamlObject::Getter> { - std::optional> get(const YamlObject &obj) const +struct YamlObject::Getter> { + std::optional> get(const YamlObject &obj) const { - if (!ipa::vectorValidateYaml(obj, Rows)) + if (!vectorValidateYaml(obj, Rows)) return std::nullopt; - ipa::Vector vector; + Vector vector; unsigned int i = 0; for (const YamlObject &entry : obj.asList()) { diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 57fde8a8fab0..de22b8e60dde 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -53,6 +53,7 @@ libcamera_internal_sources = files([ 'v4l2_pixelformat.cpp', 'v4l2_subdevice.cpp', 'v4l2_videodevice.cpp', + 'vector.cpp', 'yaml_parser.cpp', ]) diff --git a/src/libcamera/vector.cpp b/src/libcamera/vector.cpp index 8019f8cfdc85..85ca2208245a 100644 --- a/src/libcamera/vector.cpp +++ b/src/libcamera/vector.cpp @@ -5,7 +5,7 @@ * Vector and related operations */ -#include "vector.h" +#include "libcamera/internal/vector.h" #include @@ -18,8 +18,6 @@ namespace libcamera { LOG_DEFINE_CATEGORY(Vector) -namespace ipa { - /** * \class Vector * \brief Vector class @@ -346,6 +344,4 @@ bool vectorValidateYaml(const YamlObject &obj, unsigned int size) } #endif /* __DOXYGEN__ */ -} /* namespace ipa */ - } /* namespace libcamera */ diff --git a/test/meson.build b/test/meson.build index 5ed052ed62c8..4095664994fd 100644 --- a/test/meson.build +++ b/test/meson.build @@ -73,6 +73,7 @@ internal_tests = [ {'name': 'timer-thread', 'sources': ['timer-thread.cpp']}, {'name': 'unique-fd', 'sources': ['unique-fd.cpp']}, {'name': 'utils', 'sources': ['utils.cpp']}, + {'name': 'vector', 'sources': ['vector.cpp']}, {'name': 'yaml-parser', 'sources': ['yaml-parser.cpp']}, ] diff --git a/test/vector.cpp b/test/vector.cpp index 8e4ec77d7820..4fae960defc1 100644 --- a/test/vector.cpp +++ b/test/vector.cpp @@ -5,14 +5,14 @@ * Vector tests */ -#include "../src/ipa/libipa/vector.h" +#include "libcamera/internal/vector.h" #include #include #include "test.h" -using namespace libcamera::ipa; +using namespace libcamera; #define ASSERT_EQ(a, b) \ if ((a) != (b)) { \