From patchwork Wed Mar 3 09:50:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11474 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 04BAFBD80C for ; Wed, 3 Mar 2021 09:50:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 75C9B68A98; Wed, 3 Mar 2021 10:50:53 +0100 (CET) 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="i4d7t7f4"; 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 AEE6F68A69 for ; Wed, 3 Mar 2021 10:50:51 +0100 (CET) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B1DA5ED; Wed, 3 Mar 2021 10:50:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1614765051; bh=M1prSjZib5Qr7OJxo/ajImkaGnoC3t9Xl8kN4JUpUsU=; h=From:To:Cc:Subject:Date:From; b=i4d7t7f4u3gjbayy+O9HwJuphiqNR/HQQ+MSssp5+loFmQNe6mLym0zsYenkLnk0I E1bWx6UHz5XV7woIhj0Ketr1GbfeAgrIDaVM0xwuYmNA2uspVT7W6yL0mdYF8fzEsw 0pQuJBlAi0+ft/X6a6ciIg60DHT8i+WwuG7QG35U= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Mar 2021 18:50:35 +0900 Message-Id: <20210303095035.493648-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3] cros: Support the new cros camera API with set_up and tear_down 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" Implement and expose the symbol and functions that the new cros camera API requires. Since we don't actually need them, leave them empty. Update meson accordingly. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- Changes in v3: - simplify meson Changes in v2: - simplified the whole thing a ton - use the android_platform meson option --- src/android/cros/camera3_hal.cpp | 21 +++++++++++++++++++++ src/android/cros/meson.build | 17 +++++++++++++++++ src/android/meson.build | 2 ++ src/libcamera/meson.build | 1 + src/meson.build | 2 ++ 5 files changed, 43 insertions(+) create mode 100644 src/android/cros/camera3_hal.cpp create mode 100644 src/android/cros/meson.build diff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp new file mode 100644 index 00000000..31ad36ac --- /dev/null +++ b/src/android/cros/camera3_hal.cpp @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Google Inc. + * + * camera3_hal.cpp - cros-specific components of Android Camera HALv3 module + */ + +#include + +static void set_up(cros::CameraMojoChannelManagerToken *token) +{ +} + +static void tear_down() +{ +} + +cros::cros_camera_hal_t CROS_CAMERA_EXPORT CROS_CAMERA_HAL_INFO_SYM = { + .set_up = set_up, + .tear_down = tear_down +}; diff --git a/src/android/cros/meson.build b/src/android/cros/meson.build new file mode 100644 index 00000000..4aab0f20 --- /dev/null +++ b/src/android/cros/meson.build @@ -0,0 +1,17 @@ +# SPDX-License-Identifier: CC0-1.0 + +if get_option('android_platform') != 'cros' + subdir_done() +endif + +cros_hal_info_sources = files([ + 'camera3_hal.cpp', +]) + +cros_hal_info = static_library('cros_hal_info', + cros_hal_info_sources, + dependencies : dependency('libcros_camera'), + c_args : '-Wno-shadow', + include_directories : android_includes) + +libcamera_objects += cros_hal_info.extract_objects('camera3_hal.cpp') diff --git a/src/android/meson.build b/src/android/meson.build index 7004d32d..87d162c3 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -37,6 +37,8 @@ if android_enabled android_deps += [libyuv_dep] endif +subdir('cros') + android_hal_sources = files([ 'camera3_hal.cpp', 'camera_hal_manager.cpp', diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 4b5e33ce..815629db 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -149,6 +149,7 @@ libcamera = shared_library('camera', install : true, link_with : libcamera_link_with, include_directories : includes, + objects : libcamera_objects, build_rpath : '/', dependencies : libcamera_deps) diff --git a/src/meson.build b/src/meson.build index 0b26ca70..c908b067 100644 --- a/src/meson.build +++ b/src/meson.build @@ -11,6 +11,8 @@ else ipa_sign_module = false endif +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')