From patchwork Fri Apr 30 15:02:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 12138 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 CA46CBDE4C for ; Fri, 30 Apr 2021 15:02:24 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 339C268901; Fri, 30 Apr 2021 17:02:24 +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="T6InYIeK"; 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 DF7E7688A5 for ; Fri, 30 Apr 2021 17:02:22 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5EF1512C4; Fri, 30 Apr 2021 17:02:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1619794942; bh=2WystHZ7zKTwQnFZcmwwLzmzIwIU2asgyLxgukOaJfQ=; h=From:To:Cc:Subject:Date:From; b=T6InYIeKcrqluRY6yEvAQETDgs/gmZ0DMC6jxqRZgeAZfxpOAAP4nCnvpreaMaqpE cVqqxeg8MPAxJcHzvl8KSB3T3vCjkn1OXt3wOwdY4LmVIO6rxw6Mqjw2OSNTYRWimh F0yXaHFxX7XD/uYXyo6oRmENhuhlLwa6sQTY7stc= From: Kieran Bingham To: libcamera devel Date: Fri, 30 Apr 2021 16:02:19 +0100 Message-Id: <20210430150219.299389-1-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] android: Split HAL to it's own shared 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 libcamera Android HAL implementation should not be an integral part of libcamera, but a support library that utilises the libcamera public API. Move the implementation to it's own distinct library. Signed-off-by: Kieran Bingham --- Please note that this no longer requires ChromeOS to manually symlink into the camera_hal directory. A modification similar to the following should be applied to the Chrome ebuilds if this is applied: diff --git a/media-libs/libcamera/libcamera-9999.ebuild b/media-libs/libcamera/libcamera-9999.ebuild index 433357f1ef74..cf90e438cfb3 100644 --- a/media-libs/libcamera/libcamera-9999.ebuild +++ b/media-libs/libcamera/libcamera-9999.ebuild @@ -57,6 +57,4 @@ src_compile() { src_install() { meson_src_install - - dosym ../libcamera.so "/usr/$(get_libdir)/camera_hal/libcamera.so" } src/android/meson.build | 10 ++++++++++ src/libcamera/meson.build | 11 ----------- src/meson.build | 7 +++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/android/meson.build b/src/android/meson.build index 2be20c97e118..6170448a73ce 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -3,6 +3,7 @@ android_deps = [ dependency('libexif', required : get_option('android')), dependency('libjpeg', required : get_option('android')), + libcamera_dep, ] android_enabled = true @@ -66,3 +67,12 @@ android_camera_metadata = static_library('camera_metadata', android_camera_metadata_sources, c_args : '-Wno-shadow', include_directories : android_includes) + +android_hal = shared_library('android-hal', + android_hal_sources, + name_prefix : '', + link_with : android_camera_metadata, + install : true, + cpp_args : libcamera_cpp_args, + include_directories : android_includes, + dependencies : android_deps) diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index e0a48aa23ea5..f77b80b878d8 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -129,16 +129,6 @@ libcamera_deps = [ dependency('threads'), ] -libcamera_link_with = [] - -if android_enabled - libcamera_sources += android_hal_sources - includes += android_includes - libcamera_link_with += android_camera_metadata - - libcamera_deps += android_deps -endif - # We add '/' to the build_rpath as a 'safe' path to act as a boolean flag. # The build_rpath is stripped at install time by meson, so we determine at # runtime if the library is running from an installed location by checking @@ -147,7 +137,6 @@ endif libcamera = shared_library('camera', libcamera_sources, install : true, - link_with : libcamera_link_with, cpp_args : libcamera_cpp_args, include_directories : includes, objects : libcamera_objects, diff --git a/src/meson.build b/src/meson.build index 64d22b9ce5b6..9dc32751bbb1 100644 --- a/src/meson.build +++ b/src/meson.build @@ -31,11 +31,10 @@ endif libcamera_cpp_args = [] libcamera_objects = [] -# The 'android' subdir must be processed first, and the build targets -# are included directly into the libcamera library when this is enabled. -subdir('android') - +# libcamera must be built first as a dependency to the other components. subdir('libcamera') + +subdir('android') subdir('ipa') subdir('lc-compliance')