From patchwork Thu Feb 4 01:27:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11127 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 142C1BD162 for ; Thu, 4 Feb 2021 01:27:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D6042613F4; Thu, 4 Feb 2021 02:27:41 +0100 (CET) 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="at6/boQ6"; dkim-atps=neutral Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A41B060302 for ; Thu, 4 Feb 2021 02:27:39 +0100 (CET) Received: by mail-pj1-x102f.google.com with SMTP id s24so744988pjp.5 for ; Wed, 03 Feb 2021 17:27:39 -0800 (PST) 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=U0d0DtwGlOR352mRu+Zs7NWaRFQs4XMCsxNRlgUogmk=; b=at6/boQ6nVgvh0QXR2Jkv4O8jcmC+Sln81l1mgPTgY0NupZofMZYgc7XmwYpI/CkS0 9ue1Yqp00KSdbrtcxNCnWLUJYM+Z1syfua3pqEdrwVQAHHXlHN/rczwU4W2kO/O2qJyb m67DAm937N0gL6PoX9mvQZx7SxatY8lZ2cHJ4= 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=U0d0DtwGlOR352mRu+Zs7NWaRFQs4XMCsxNRlgUogmk=; b=GWSXk74zlqNxTeRZ9ST5DcylnXfJWjBTRA4wP05WbuyUCEzwExtApVII+LioXBTsDb yjpRYfyKxOfEzZoRy5YciDzTRdAJqTI1i3OVvkLjDQevGx2wKp4Wyvvy/xoToQNFyl4L p87M2kiSmJA9S3yalf1JacObsSMu9ehRkblROf6gzL2m66Tm5HwjB72a6gfHZXPhBlFB UI68f7pHmitlzBpS/6rG6q58KrQxq2cG7/EMgVJ49PyyxKHoWsyr5zzZ7w1bfwujR7G4 E+ilNNgttWu3MOM+heOx5peRN4gNuRu3TwC0Mci1LC7U+p3gl67W5chZI330vnztTQ0Y qYhg== X-Gm-Message-State: AOAM532sAEmnobBrYwE7aSw8vgpAVlXzH5eJujcQ8WB1FCDmNrhm2Cbk PlUqLURldTCXoq9hGTZGOfgAUO+YIOyUG/4s X-Google-Smtp-Source: ABdhPJy3jFnmmvTAAk6yQJSmlsuhWbHoNCdE34XNnhAFyZmq0VMDcxsHoAgs25pwg9+aYz+ylMDGCw== X-Received: by 2002:a17:90a:6d96:: with SMTP id a22mr5897787pjk.84.1612402058062; Wed, 03 Feb 2021 17:27:38 -0800 (PST) Received: from hiroh.c.googlers.com.com (128.141.236.35.bc.googleusercontent.com. [35.236.141.128]) by smtp.gmail.com with ESMTPSA id j26sm3300936pfa.35.2021.02.03.17.27.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Feb 2021 17:27:37 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 01:27:30 +0000 Message-Id: <20210204012731.1942112-2-hiroh@chromium.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog In-Reply-To: <20210204012731.1942112-1-hiroh@chromium.org> References: <20210204012731.1942112-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 1/2] subprojects: Add libyuv and built if -Dandroid=enabled 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" Android HAL adaptation layer may need image processing, for example, scaling and format conversion. Libyuv is a general image processing. This adds libyuv to subprojects, so that it is forked locally and can be used with Android HAL implementation code. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- README.rst | 2 +- meson.build | 2 +- src/android/meson.build | 17 +++++++++++++++++ subprojects/.gitignore | 1 + subprojects/libyuv.wrap | 4 ++++ 5 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 subprojects/.gitignore create mode 100644 subprojects/libyuv.wrap -- 2.30.0.365.g02bc693789-goog diff --git a/README.rst b/README.rst index 251291b7..08bfd5ad 100644 --- a/README.rst +++ b/README.rst @@ -47,7 +47,7 @@ A C++ toolchain: [required] Either {g++, clang} Meson Build system: [required] - meson (>= 0.51) ninja-build pkg-config + meson (>= 0.55) ninja-build pkg-config If your distribution doesn't provide a recent enough version of meson, you can install or upgrade it using pip3. diff --git a/meson.build b/meson.build index 743cb1d2..be77191d 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # SPDX-License-Identifier: CC0-1.0 project('libcamera', 'c', 'cpp', - meson_version : '>= 0.53', + meson_version : '>= 0.55', version : '0.0.0', default_options : [ 'werror=true', diff --git a/src/android/meson.build b/src/android/meson.build index 3d4d3be4..7619517a 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -14,6 +14,23 @@ foreach dep : android_deps endif endforeach +if android_enabled + cmake = import('cmake') + + libyuv_vars = cmake.subproject_options() + libyuv_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'}) + libyuv_vars.set_override_option('cpp_std', 'c++17') + libyuv_vars.append_compile_args('cpp', + '-Wno-sign-compare', + '-Wno-unused-variable', + '-Wno-unused-parameter') + libyuv_vars.append_link_args('-ljpeg') + libyuv = cmake.subproject('libyuv', options : libyuv_vars) + libyuv_dep = libyuv.dependency('yuv') + + android_deps += [ libyuv_dep, ] +endif + android_hal_sources = files([ 'camera3_hal.cpp', 'camera_hal_manager.cpp', diff --git a/subprojects/.gitignore b/subprojects/.gitignore new file mode 100644 index 00000000..410b8bd6 --- /dev/null +++ b/subprojects/.gitignore @@ -0,0 +1 @@ +/libyuv \ No newline at end of file diff --git a/subprojects/libyuv.wrap b/subprojects/libyuv.wrap new file mode 100644 index 00000000..8ba51fa0 --- /dev/null +++ b/subprojects/libyuv.wrap @@ -0,0 +1,4 @@ +[wrap-git] +directory = libyuv +url = https://chromium.googlesource.com/libyuv/libyuv.git +revision = 93b1b332cd60b56ab90aea14182755e379c28a80