From patchwork Wed Jun 16 15:11:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12620 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 F0A30C321B for ; Wed, 16 Jun 2021 15:12:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C2C86895A; Wed, 16 Jun 2021 17:12:03 +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="dw/7iAGM"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B6F016894D for ; Wed, 16 Jun 2021 17:11:58 +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 4A740101E; Wed, 16 Jun 2021 17:11:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1623856318; bh=LEAJjH5iOfmJHKFpfztIs61o7CeXs5n2x9HdN/fTY6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dw/7iAGM+JdgBG8vdWnndP+WHn8sHQfoKiTEcbYCLRTKn5w2tiB2RZNwblXUJBW98 IPl5wcNeIjrCcQZvewaZbkB+SCrXR+Ff/7kLh/H5IGqUuBdeuW+bnWCnVNS+IGCf34 zCSWiUvXpIbWjTGQIdVIHyM8ATu3deBBcUUyDJFM= From: Kieran Bingham To: libcamera devel Date: Wed, 16 Jun 2021 16:11:51 +0100 Message-Id: <20210616151152.3856595-6-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210616151152.3856595-1-kieran.bingham@ideasonboard.com> References: <20210616151152.3856595-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/6] libcamera-platform: Move File to platform 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 platform helper and not part of the libcamera API. Move it to the platform library to allow usage when reading and writing to files. Signed-off-by: Kieran Bingham Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain --- include/libcamera/internal/meson.build | 1 - include/libcamera/{internal => platform}/file.h | 6 +++--- include/libcamera/platform/meson.build | 1 + src/ipa/vimc/vimc.cpp | 3 +-- src/{libcamera => libcamera-platform}/file.cpp | 4 ++-- src/libcamera-platform/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, 13 insertions(+), 16 deletions(-) rename include/libcamera/{internal => platform}/file.h (91%) rename src/{libcamera => libcamera-platform}/file.cpp (99%) diff --git a/include/libcamera/internal/meson.build b/include/libcamera/internal/meson.build index 1ff16f54a68b..1187cc1f63e4 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/include/libcamera/internal/file.h b/include/libcamera/platform/file.h similarity index 91% rename from include/libcamera/internal/file.h rename to include/libcamera/platform/file.h index f0b313a5faae..68108ff6039d 100644 --- a/include/libcamera/internal/file.h +++ b/include/libcamera/platform/file.h @@ -4,8 +4,8 @@ * * file.h - File I/O operations */ -#ifndef __LIBCAMERA_INTERNAL_FILE_H__ -#define __LIBCAMERA_INTERNAL_FILE_H__ +#ifndef __LIBCAMERA_PLATFORM_FILE_H__ +#define __LIBCAMERA_PLATFORM_FILE_H__ #include #include @@ -74,4 +74,4 @@ private: } /* namespace libcamera */ -#endif /* __LIBCAMERA_INTERNAL_FILE_H__ */ +#endif /* __LIBCAMERA_PLATFORM_FILE_H__ */ diff --git a/include/libcamera/platform/meson.build b/include/libcamera/platform/meson.build index a0f89523f2b2..a5da16554f6e 100644 --- a/include/libcamera/platform/meson.build +++ b/include/libcamera/platform/meson.build @@ -6,6 +6,7 @@ libcamera_platform_headers = files([ 'bound_method.h', 'event_dispatcher.h', 'event_dispatcher_poll.h', + 'file.h', 'log.h', 'message.h', 'object.h', diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index 64ed51097065..1c7632bdb53b 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -17,10 +17,9 @@ #include #include +#include #include -#include "libcamera/internal/file.h" - namespace libcamera { LOG_DEFINE_CATEGORY(IPAVimc) diff --git a/src/libcamera/file.cpp b/src/libcamera-platform/file.cpp similarity index 99% rename from src/libcamera/file.cpp rename to src/libcamera-platform/file.cpp index c554074c2e51..6ac33659a7ae 100644 --- a/src/libcamera/file.cpp +++ b/src/libcamera-platform/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 platform/file.h * \brief File I/O operations */ diff --git a/src/libcamera-platform/meson.build b/src/libcamera-platform/meson.build index afdc4465da28..78d7d894a63f 100644 --- a/src/libcamera-platform/meson.build +++ b/src/libcamera-platform/meson.build @@ -4,6 +4,7 @@ libcamera_platform_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 122811e2bcae..f3fcc20806fa 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 a615ca91257e..093046c7ab17 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 f83ca4b1f6aa..9e2d1fd634aa 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -17,7 +17,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 dea00b072519..939abefdf775 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..cdbfd9fa6d0b 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 514718214317..96aad8351cf9 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;