[libcamera-devel] [PATCH v4 1/4] android: Define OS_CHROMEOS macro if android_platform=cros

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Apr 4 01:11:30 CEST 2021


Hi Hiro,

Just one small comment.

On Sat, Apr 03, 2021 at 10:10:12PM +0900, Hirokazu Honda wrote:
> Android Camera HAL 3 API used in ChromeOS has a ChromeOS own
> extension, for example, crop_rotate_scale_degrees in
> camera3_stream. As those extensions are not available on Android
> platforms, introduce a OS_CHROMEOS macro that can be used to
> compile CrOS-specific code conditionally. The macro is defined
> if and only if android_platform is 'cros'.
> 
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/android/meson.build   | 4 ++++
>  src/libcamera/meson.build | 1 +
>  src/meson.build           | 1 +
>  3 files changed, 6 insertions(+)
> 
> diff --git a/src/android/meson.build b/src/android/meson.build
> index 8e7d07d9..2be20c97 100644
> --- a/src/android/meson.build
> +++ b/src/android/meson.build
> @@ -35,6 +35,10 @@ endif
>  
>  android_deps += [libyuv_dep]
>  
> +if get_option('android_platform') == 'cros'
> +   libcamera_cpp_args += [ '-DOS_CHROMEOS']

Extra space after [. I can fix this when applying.

> +endif
> +
>  subdir('cros')
>  
>  android_hal_sources = files([
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 815629db..e0a48aa2 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -148,6 +148,7 @@ libcamera = shared_library('camera',
>                             libcamera_sources,
>                             install : true,
>                             link_with : libcamera_link_with,
> +                           cpp_args : libcamera_cpp_args,
>                             include_directories : includes,
>                             objects : libcamera_objects,
>                             build_rpath : '/',
> diff --git a/src/meson.build b/src/meson.build
> index c908b067..8c1c8763 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -11,6 +11,7 @@ else
>      ipa_sign_module = false
>  endif
>  
> +libcamera_cpp_args = []
>  libcamera_objects = []
>  
>  # The 'android' subdir must be processed first, and the build targets

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list