HACK: android: Make libjpeg optional
* To build using NDK.
This commit is contained in:
@@ -15,7 +15,9 @@
|
||||
|
||||
#include <libcamera/formats.h>
|
||||
|
||||
#ifdef HAVE_LIBJPEG
|
||||
#include "jpeg/post_processor_jpeg.h"
|
||||
#endif
|
||||
#include "yuv/post_processor_yuv.h"
|
||||
|
||||
#include "camera_buffer.h"
|
||||
@@ -97,9 +99,11 @@ int CameraStream::configure()
|
||||
postProcessor_ = std::make_unique<PostProcessorYuv>();
|
||||
break;
|
||||
|
||||
#ifdef HAVE_LIBJPEG
|
||||
case formats::MJPEG:
|
||||
postProcessor_ = std::make_unique<PostProcessorJpeg>(cameraDevice_);
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
LOG(HAL, Error) << "Unsupported format: " << outFormat;
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
android_deps = [
|
||||
dependency('libexif', required : get_option('android')),
|
||||
dependency('libjpeg', required : get_option('android')),
|
||||
libcamera_private,
|
||||
libyuv_dep,
|
||||
]
|
||||
@@ -16,6 +14,12 @@ foreach dep : android_deps
|
||||
endif
|
||||
endforeach
|
||||
|
||||
libjpeg_dep = dependency('libjpeg', required : false)
|
||||
if libjpeg_dep.found()
|
||||
config_h.set('HAVE_LIBJPEG', 1)
|
||||
dependency('libexif', required : true)
|
||||
endif
|
||||
|
||||
android_hal_sources = files([
|
||||
'camera3_hal.cpp',
|
||||
'camera_capabilities.cpp',
|
||||
@@ -33,7 +37,9 @@ android_hal_sources = files([
|
||||
android_cpp_args = []
|
||||
|
||||
subdir('cros')
|
||||
subdir('jpeg')
|
||||
if libjpeg_dep.found()
|
||||
subdir('jpeg')
|
||||
endif
|
||||
subdir('mm')
|
||||
|
||||
android_camera_metadata_sources = files([
|
||||
|
||||
@@ -7,9 +7,11 @@ libcamera_internal_sources += files([
|
||||
'virtual.cpp',
|
||||
])
|
||||
|
||||
libjpeg = dependency('libjpeg', required : true)
|
||||
libjpeg = dependency('libjpeg', required : false)
|
||||
|
||||
libcamera_deps += [libyuv_dep]
|
||||
libcamera_deps += [libjpeg]
|
||||
if libjpeg.found()
|
||||
libcamera_deps += [libjpeg]
|
||||
endif
|
||||
|
||||
subdir('data')
|
||||
|
||||
@@ -53,7 +53,10 @@ if (pipelines.contains('virtual') or get_option('android').allowed()) and \
|
||||
'-Wno-sign-compare',
|
||||
'-Wno-unused-variable',
|
||||
'-Wno-unused-parameter')
|
||||
libyuv_vars.append_link_args('-ljpeg')
|
||||
libjpeg = dependency('libjpeg', required : false)
|
||||
if libjpeg.found()
|
||||
libyuv_vars.append_link_args('-ljpeg')
|
||||
endif
|
||||
libyuv = cmake.subproject('libyuv', options : libyuv_vars)
|
||||
|
||||
# Meson fails to apply the -fPIC flag to static libraries produced by CMake
|
||||
|
||||
Reference in New Issue
Block a user