From patchwork Wed Feb 3 06:51:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11113 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 8256DBD162 for ; Wed, 3 Feb 2021 06:51:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 48CA66843E; Wed, 3 Feb 2021 07:51:44 +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="cgoHrWv+"; dkim-atps=neutral Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E565168439 for ; Wed, 3 Feb 2021 07:51:42 +0100 (CET) Received: by mail-pg1-x529.google.com with SMTP id o63so16629064pgo.6 for ; Tue, 02 Feb 2021 22:51:42 -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=cgoHrWv+Yr2wkl6K40LsuG8Ue9sBEVqWAJSASBSwRvLNAirLHxpjOh78UuyhiGcKiV DWjY5RWm3ivU+CQ1kkk1iBWpuvlsL2cMH1mC7i8lrlP8NY8uYJuKzkfu+49bGyqMPWeU 9HkSgyFFP/Knc8vQcczVFTIIsrAaUXRy5MyQw= 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=XkixvelMmqo6t9PYqCjqH5yrJP70bsg+QHhQDEUhiVCCnaAPd/4axkrD1Cw2NIkdDP HFNiQOJTgUZjpruObTk/YppKtPAT1J0NlVp7Lh+zZkbyUqBEA9AycxNJQbHiUzI8Ljcx eLVD3ULtT3NZ6ZsmuVL9wOyQOpOPZMehVw1diOt9jWGAbB09McmIy0Yudh5KPcS3ft9T NyALknFl9BkHcPD+NG3AkSo7tINaKzvGpNBK/f6vUG6JGgr2Zu3p8XP3KRPT1XGvcMQQ So8L9FCYJHQIoVG4/lNIGSIYyHVxUOeC/MvF+5ehLDjex8rNO+fpHRg98wZrAroEjrNO E0Ag== X-Gm-Message-State: AOAM531Ib+x5pB9wBEZcnuvrylmaT/gij2DwsAu4XQ9JiRFyJASGH7YF XxBQ0Ag+Y3+orTiPEV0vKWIMuaSFTHFCXXc6 X-Google-Smtp-Source: ABdhPJxkqxriynD5+B+rphqBlqtf2IBeO2p+365wGGGGK+CU2UnDepKMTykLb61EwZn4WIz4XqLcDA== X-Received: by 2002:aa7:94a2:0:b029:1b8:eba7:773e with SMTP id a2-20020aa794a20000b02901b8eba7773emr1769936pfl.51.1612335100798; Tue, 02 Feb 2021 22:51:40 -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 i62sm978301pfe.84.2021.02.02.22.51.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 22:51:40 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Feb 2021 06:51:27 +0000 Message-Id: <20210203065128.1738003-2-hiroh@chromium.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog In-Reply-To: <20210203065128.1738003-1-hiroh@chromium.org> References: <20210203065128.1738003-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 From patchwork Wed Feb 3 06:51:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11114 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 C750FBD160 for ; Wed, 3 Feb 2021 06:51:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 91F3368441; Wed, 3 Feb 2021 07:51:46 +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="fwTKTwul"; dkim-atps=neutral Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 24C2268437 for ; Wed, 3 Feb 2021 07:51:44 +0100 (CET) Received: by mail-pf1-x436.google.com with SMTP id w18so16013193pfu.9 for ; Tue, 02 Feb 2021 22:51:44 -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=9AaFsGlzRKUDJtMI4vxfhqCS520cHdGWPLvIeRFU23s=; b=fwTKTwulqIhWig8MvrxydxWztVA+cI1QhbogYcTPkmYfD9kvNGVAj3X3LLxqq68gap ApMHGO436tCPB68LTAoMr3qRIMmsClPjOw7ZcT75uRU1A8oCvNPgHjXKdYSE0JNHyw6B ZuTdFBgmIBS1tdeCqLNECBG+2zsN3kgamGt5M= 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=9AaFsGlzRKUDJtMI4vxfhqCS520cHdGWPLvIeRFU23s=; b=OnFQ0eWkHuvv7YoQGSTXC/LdRvVag6EJvEa8b90kGxGf3sArKWe5ZU+bovKYqBXa+X 4LCGRBhhLLxMAp0qZbAazM//UyhwVshLkoKDmiNHAM1q739ctt4J34w80DvgsZhfbGtn rnVRdRNeahQJOmqBuBr21ri3jxxT5rge0wWk5l9Qc+Ewy1GV1u/surlOlSuKFwgGWBga LhBWkqotU/eQqf4uODpa5Qo7F2lV5Jh7DwBfggWTDTlK350gF71oi2t5CvE+oQ59T5n3 V/Dr9Om7RnvP4BE/tMEc8s7qeN8uL0zqwTO2L3XZ4SFhcHjGT2CDb3UokB1naMOg4V4n /80w== X-Gm-Message-State: AOAM530ojqjf9OwTCB137/yc3ldhImHAHvZq+B88QRVKW8DBZKfTT8y3 hcfhNmjVjQxBthAT+PCOX8Ben1cHPhSuDI2k X-Google-Smtp-Source: ABdhPJzUiOjni9D2d79lCanIYM+SIGBAw32iGx8kLSb29EKXaNQcm3HdJQcU/0g72xPfjccD2ajdnA== X-Received: by 2002:a05:6a00:2127:b029:1bb:b6de:c875 with SMTP id n7-20020a056a002127b02901bbb6dec875mr1826413pfj.72.1612335102231; Tue, 02 Feb 2021 22:51:42 -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 i62sm978301pfe.84.2021.02.02.22.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 22:51:41 -0800 (PST) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 3 Feb 2021 06:51:28 +0000 Message-Id: <20210203065128.1738003-3-hiroh@chromium.org> X-Mailer: git-send-email 2.30.0.365.g02bc693789-goog In-Reply-To: <20210203065128.1738003-1-hiroh@chromium.org> References: <20210203065128.1738003-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 2/2] meson: Add download_subprojects option 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" This adds download_subprojects option. It controls whether a library in meson subprojects is downloaded as specified. The motivation of the option is there is an environment where the download is prohibited by "--wrap-mode nodownload". The local library code (e.g. libyuv) is built with in such a build environment if download_subprojects is set to false. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi --- meson_options.txt | 5 +++++ src/android/meson.build | 32 ++++++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) -- 2.30.0.365.g02bc693789-goog diff --git a/meson_options.txt b/meson_options.txt index 53f2675e..bd92475f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -14,6 +14,11 @@ option('gstreamer', value : 'auto', description : 'Compile libcamera GStreamer plugin') +option('download_subprojects', + type : 'boolean', + value : 'true', + description: 'Download subprojects in build') + option('pipelines', type : 'array', choices : ['ipu3', 'raspberrypi', 'rkisp1', 'simple', 'uvcvideo', 'vimc'], diff --git a/src/android/meson.build b/src/android/meson.build index 7619517a..03d847ee 100644 --- a/src/android/meson.build +++ b/src/android/meson.build @@ -15,20 +15,24 @@ foreach dep : android_deps 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, ] + if get_option('download_subprojects') + 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, ] + else + android_deps += [ dependency('libyuv') ] + endif endif android_hal_sources = files([