Skip to content

Commit

Permalink
subprojects: Add libyuv and built if -Dandroid=enabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hirokazu Honda authored and pinchartl committed Feb 4, 2021
1 parent 5b568b7 commit 9109bcf
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
17 changes: 17 additions & 0 deletions src/android/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions subprojects/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/libyuv
4 changes: 4 additions & 0 deletions subprojects/libyuv.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[wrap-git]
directory = libyuv
url = https://chromium.googlesource.com/libyuv/libyuv.git
revision = 93b1b332cd60b56ab90aea14182755e379c28a80

0 comments on commit 9109bcf

Please sign in to comment.