From patchwork Fri Jun 25 01:35:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12703 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 0CEE4C321D for ; Fri, 25 Jun 2021 01:35:55 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A963E684F2; Fri, 25 Jun 2021 03:35:54 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="VlqZnF3j"; 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 A8BC0684DF for ; Fri, 25 Jun 2021 03:35:47 +0200 (CEST) Received: from Monstersaurus.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 436738B6; Fri, 25 Jun 2021 03:35:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1624584947; bh=okcxq3JgyqOPsSSfCz2poZh9TuQcyV1v9pxK7BsgKfU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlqZnF3jrc2r4owMQ38KyHTJzmipkYx+DtRlcIFyvqngY3OHREM7CCJHkvkoXMFAc kfPfFfBbDU18QKWjhuBV5r9HWiOBI/9QWSBXvytdbx4Vx4VvzhNlSJNYYGMh75naad 9B98WpgVULLuK6pNoKxSWJN+reHU2GsJHsSCn1HA= From: Kieran Bingham To: libcamera devel Date: Fri, 25 Jun 2021 02:35:33 +0100 Message-Id: <20210625013539.625803-11-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210625013539.625803-1-kieran.bingham@ideasonboard.com> References: <20210625013539.625803-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/16] libcamera/base: Move File to base library 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" The File abstraction is a base helper and not part of the libcamera API. Move it to the base library to allow usage when reading and writing to files. Signed-off-by: Kieran Bingham Reviewed-by: Hirokazu Honda Reviewed-by: Paul Elder Reviewed-by: Laurent Pinchart --- include/libcamera/{internal => base}/file.h | 6 +++--- include/libcamera/base/meson.build | 1 + include/libcamera/internal/meson.build | 1 - src/ipa/vimc/vimc.cpp | 11 ++++------- src/libcamera/{ => base}/file.cpp | 4 ++-- src/libcamera/base/meson.build | 1 + src/libcamera/ipa_manager.cpp | 2 +- src/libcamera/ipa_module.cpp | 2 +- src/libcamera/meson.build | 1 - src/libcamera/sysfs.cpp | 3 +-- test/file.cpp | 2 +- test/hotplug-cameras.cpp | 3 +-- 12 files changed, 16 insertions(+), 21 deletions(-) rename include/libcamera/{internal => base}/file.h (91%) rename src/libcamera/{ => base}/file.cpp (99%) diff --git a/include/libcamera/internal/file.h b/include/libcamera/base/file.h similarity index 91% rename from include/libcamera/internal/file.h rename to include/libcamera/base/file.h index 44621ceb4c19..e8e4b76e1a4e 100644 --- a/include/libcamera/internal/file.h +++ b/include/libcamera/base/file.h @@ -4,8 +4,8 @@ * * file.h - File I/O operations */ -#ifndef __LIBCAMERA_INTERNAL_FILE_H__ -#define __LIBCAMERA_INTERNAL_FILE_H__ +#ifndef __LIBCAMERA_BASE_FILE_H__ +#define __LIBCAMERA_BASE_FILE_H__ #include #include @@ -75,4 +75,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_FILE_H__ */ +#endif /* __LIBCAMERA_BASE_FILE_H__ */ diff --git a/include/libcamera/base/meson.build b/include/libcamera/base/meson.build index 7a858dcb6f1a..6fc6c138a5fd 100644 --- a/include/libcamera/base/meson.build +++ b/include/libcamera/base/meson.build @@ -7,6 +7,7 @@ libcamera_base_headers = files([ 'class.h', 'event_dispatcher.h', 'event_dispatcher_poll.h', + 'file.h', 'log.h', 'message.h', 'object.h', diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 64f50373a7fb..b10285edac27 100644 --- a/include/libcamera/internal/meson.build +++ b/include/libcamera/internal/meson.build @@ -23,7 +23,6 @@ libcamera_internal_headers = files([ 'device_enumerator_sysfs.h', 'device_enumerator_udev.h', 'event_notifier.h', - 'file.h', 'formats.h', 'ipa_manager.h', 'ipa_module.h', diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index 9ffd07f493a1..cb9414e7b97a 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -5,21 +5,18 @@ * ipa_vimc.cpp - Vimc Image Processing Algorithm module */ -#include - #include +#include #include #include #include -#include +#include +#include #include #include - -#include - -#include "libcamera/internal/file.h" +#include namespace libcamera { diff --git a/src/libcamera/file.cpp b/src/libcamera/base/file.cpp similarity index 99% rename from src/libcamera/file.cpp rename to src/libcamera/base/file.cpp index def0f60d044b..073666fa6f66 100644 --- a/src/libcamera/file.cpp +++ b/src/libcamera/base/file.cpp @@ -5,7 +5,7 @@ * file.cpp - File I/O operations */ -#include "libcamera/internal/file.h" +#include #include #include @@ -17,7 +17,7 @@ #include /** - * \file file.h + * \file base/file.h * \brief File I/O operations */ diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build index 7a19c67c51b8..fb8ed79acd8e 100644 --- a/src/libcamera/base/meson.build +++ b/src/libcamera/base/meson.build @@ -5,6 +5,7 @@ libcamera_base_sources = files([ 'bound_method.cpp', 'event_dispatcher.cpp', 'event_dispatcher_poll.cpp', + 'file.cpp', 'log.cpp', 'message.cpp', 'object.cpp', diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index 35c7259801fa..b4606c6159e5 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -12,10 +12,10 @@ #include #include +#include #include #include -#include "libcamera/internal/file.h" #include "libcamera/internal/ipa_module.h" #include "libcamera/internal/ipa_proxy.h" #include "libcamera/internal/pipeline_handler.h" diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp index 7ab5557916e7..984c1fed9bdb 100644 --- a/src/libcamera/ipa_module.cpp +++ b/src/libcamera/ipa_module.cpp @@ -23,10 +23,10 @@ #include +#include #include #include -#include "libcamera/internal/file.h" #include "libcamera/internal/pipeline_handler.h" /** diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 86212cec0281..58eee14aed97 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -16,7 +16,6 @@ libcamera_sources = files([ 'device_enumerator.cpp', 'device_enumerator_sysfs.cpp', 'event_notifier.cpp', - 'file.cpp', 'file_descriptor.cpp', 'formats.cpp', 'framebuffer_allocator.cpp', diff --git a/src/libcamera/sysfs.cpp b/src/libcamera/sysfs.cpp index 4372b1348178..44c3331b4e1c 100644 --- a/src/libcamera/sysfs.cpp +++ b/src/libcamera/sysfs.cpp @@ -12,10 +12,9 @@ #include #include +#include #include -#include "libcamera/internal/file.h" - /** * \file sysfs.h * \brief Miscellaneous utility functions to access sysfs diff --git a/test/file.cpp b/test/file.cpp index b80667ae5b2f..d768e3235b8c 100644 --- a/test/file.cpp +++ b/test/file.cpp @@ -13,7 +13,7 @@ #include #include -#include "libcamera/internal/file.h" +#include #include "test.h" diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp index bb160537c5d5..df56040350c5 100644 --- a/test/hotplug-cameras.cpp +++ b/test/hotplug-cameras.cpp @@ -15,11 +15,10 @@ #include #include +#include #include #include -#include "libcamera/internal/file.h" - #include "test.h" using namespace libcamera;