diff options
author | Hirokazu Honda <hiroh@chromium.org> | 2021-02-04 01:27:30 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-02-04 05:03:53 +0200 |
commit | 9109bcf22c7f5f48afcf4234a4d4a596d6bd7bd2 (patch) | |
tree | 742c53537463bc56d02d1b8001254640b8b05907 | |
parent | 5b568b7e41e394b5317057312d07ff71b4d571f7 (diff) |
subprojects: Add libyuv and built if -Dandroid=enabled
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 <hiroh@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r-- | README.rst | 2 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | src/android/meson.build | 17 | ||||
-rw-r--r-- | subprojects/.gitignore | 1 | ||||
-rw-r--r-- | subprojects/libyuv.wrap | 4 |
5 files changed, 24 insertions, 2 deletions
@@ -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 |