From patchwork Mon May 24 11:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12387 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 9F8B3C3201 for ; Mon, 24 May 2021 11:56:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 414A968921; Mon, 24 May 2021 13:56:50 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="j5eVjBnC"; dkim-atps=neutral Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 883DD602B0 for ; Mon, 24 May 2021 13:56:48 +0200 (CEST) Received: by mail-pl1-x62e.google.com with SMTP id t21so14524313plo.2 for ; Mon, 24 May 2021 04:56:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lXE2YWM6EqATPCpKWMrkx6hm6hxJy4BMvVLRSweXb9o=; b=j5eVjBnCQb14Cytpe/XgP/ZmoYymRWR1CUVMl95DijWhxHjoez+6gp6M1z6qcbEy2u XSydt+468EVB/CIkNqQjgpq38hi2OW1MxK+iS3Cx4ter4bkUmw4yoCZm85q1qz+pnj7S sYno2dPIowQUZHHBvhD6CO0YLlxdrxRqYS/2k= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lXE2YWM6EqATPCpKWMrkx6hm6hxJy4BMvVLRSweXb9o=; b=Xey0HrEaot4zHnuCjygPWuDVd8Q55gjFBYx2zQ5CVF3dqv0gmDVIXeSY5uNSB19Eo8 OncE40+u8kk9xZ8BmsPoT+YRPlX6+V3stpIDeTcnnOq8MWAYu2fDzyRuaLhOEuuvH+Cl OdNFkEr0IU4k76ea/lzwr99lcOuUDLdMcFckeRHIJseHRIMNTD3agsm7SFVivoTRc8oU eE2uuVbzCEPcyVOGlrCaSOtQYbrGUlb1CDdNElP/f3yC/RsWYzRjY9RgjqhJR8OkPYTE FBzAu3kHL1YnN6MhfZN9876Fromo0pLKbeRFSSAfoCkeohEMpl3RN+WwAdV3sQoGPgth LAvA== X-Gm-Message-State: AOAM530wRzlT3xbio3aCrHqDAisr60iHIyMc/bHTPWc2EFuwyYj1lQ9i ZNv6eNXvCooKguyBjm7ODbd5i0FnLCk34w== X-Google-Smtp-Source: ABdhPJyVWqS/SKXQEo4ihXnWUHM5h65bP/4PhkGMsZTitf7bFSsWa+duaoQzwa4ik52Z+V12E7p4Iw== X-Received: by 2002:a17:90a:17a6:: with SMTP id q35mr24552485pja.118.1621857406933; Mon, 24 May 2021 04:56:46 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:7208:465c:c4e:2dc3]) by smtp.gmail.com with ESMTPSA id t19sm11149980pfg.70.2021.05.24.04.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 04:56:46 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 24 May 2021 20:56:39 +0900 Message-Id: <20210524115640.2334778-2-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.818.g46aad6cb9e-goog In-Reply-To: <20210524115640.2334778-1-hiroh@chromium.org> References: <20210524115640.2334778-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH RFC 1/2] android: Move ChromeOS specific Camera HAL calls to camera3_hal.cpp 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" ChromeOS specific Camera HAL calls are in android/cros directory. Moves them to android/camera3_hal.cpp by enclosing them with OS_CHROMEOS macro. Signed-off-by: Hirokazu Honda --- Found LOG macro conflict issues in libchrome and libcamera. See the error message. https://paste.debian.net/1198594/ I ask for comments, while I hack the conflict by undefining LOG of libcamera. --- src/android/camera3_hal.cpp | 27 +++++++++++++++++++++++++++ src/android/cros/camera3_hal.cpp | 21 --------------------- src/android/cros/meson.build | 17 ----------------- src/android/meson.build | 3 +-- 4 files changed, 28 insertions(+), 40 deletions(-) delete mode 100644 src/android/cros/camera3_hal.cpp delete mode 100644 src/android/cros/meson.build -- 2.31.1.818.g46aad6cb9e-goog diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp index 08773d33..f2d4799f 100644 --- a/src/android/camera3_hal.cpp +++ b/src/android/camera3_hal.cpp @@ -5,6 +5,14 @@ * camera3_hal.cpp - Android Camera HALv3 module */ +#if defined(OS_CHROMEOS) +#include +/* HACK. LOG is defined in logging.h in chrome. It conflicts LOG macro in + * libcamera. + */ +#undef LOG +#endif + #include #include "libcamera/internal/log.h" @@ -115,3 +123,22 @@ camera_module_t HAL_MODULE_INFO_SYM = { .init = hal_init, .reserved = {}, }; + +#if defined(OS_CHROMEOS) +/*------------------------------------------------------------------------------ + * ChromeOS specific Camera HAL callbacks + */ + +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 +}; +#endif diff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp deleted file mode 100644 index 31ad36ac..00000000 --- a/src/android/cros/camera3_hal.cpp +++ /dev/null @@ -1,21 +0,0 @@ -/* 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 deleted file mode 100644 index 4aab0f20..00000000 --- a/src/android/cros/meson.build +++ /dev/null @@ -1,17 +0,0 @@ -# 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 2be20c97..84144f33 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -37,10 +37,9 @@ android_deps += [libyuv_dep] if get_option('android_platform') == 'cros' libcamera_cpp_args += [ '-DOS_CHROMEOS'] + android_deps += [dependency('libcros_camera')] endif -subdir('cros') - android_hal_sources = files([ 'camera3_hal.cpp', 'camera_hal_manager.cpp',