From patchwork Thu Feb 25 10:42:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 11378 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 B1AF0BD1F1 for ; Thu, 25 Feb 2021 10:42:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7FA6B68A51; Thu, 25 Feb 2021 11:42:34 +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="VxODHMTv"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E186A68A3F for ; Thu, 25 Feb 2021 11:42:32 +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 F2BF058E; Thu, 25 Feb 2021 11:42:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1614249752; bh=ERxrHaqfzX4hVm/VZIEgRUDP3yD7A3bongyaX2Khpd8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VxODHMTvHwdiTgHqjeswf5eN1062Q2d7o6ZXGTdhIyoxlW8EhBcVl52l6RUJ3UsrE li7sxsdGGdNdFP56CU+AlmZgD8O4c9mABvUFOtfPaL0KKYELFbjYhAy4q0Mugqf8HI aU9FJmIJqR4fP+j3GCf9BaN3qHNEamT1gof2L134= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 25 Feb 2021 19:42:17 +0900 Message-Id: <20210225104217.108792-4-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210225104217.108792-1-paul.elder@ideasonboard.com> References: <20210225104217.108792-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/3] 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. Signed-off-by: Paul Elder --- src/cros/camera3_hal.cpp | 21 +++++++++++++++++++++ src/cros/meson.build | 16 ++++++++++++++++ src/libcamera/meson.build | 6 ++++++ src/meson.build | 4 ++++ 4 files changed, 47 insertions(+) create mode 100644 src/cros/camera3_hal.cpp create mode 100644 src/cros/meson.build diff --git a/src/cros/camera3_hal.cpp b/src/cros/camera3_hal.cpp new file mode 100644 index 00000000..31ad36ac --- /dev/null +++ b/src/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/cros/meson.build b/src/cros/meson.build new file mode 100644 index 00000000..31aa58c9 --- /dev/null +++ b/src/cros/meson.build @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: CC0-1.0 + +cros_hal_include_dir = '/mnt/host/source/src/aosp/external/libchrome' + +cros_hal_info_sources = files([ + 'camera3_hal.cpp', +]) + +cros_hal_info = static_library('cros_hal_info', + cros_hal_info_sources, + c_args : '-Wno-shadow', + include_directories : [cros_includes, + cros_hal_include_dir, + android_includes]) + +cros_hal_info_obj = cros_hal_info.extract_objects('camera3_hal.cpp') diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 4b5e33ce..c40eb41f 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -139,6 +139,11 @@ if android_enabled libcamera_deps += android_deps endif +libcamera_objects = [] +if cros_enabled + libcamera_objects += cros_hal_info_obj +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 @@ -149,6 +154,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..ec85cc47 100644 --- a/src/meson.build +++ b/src/meson.build @@ -15,6 +15,10 @@ endif # are included directly into the libcamera library when this is enabled. subdir('android') +if cros_enabled + subdir('cros') +endif + subdir('libcamera') subdir('ipa')