diff options
Diffstat (limited to 'src/android/cros')
-rw-r--r-- | src/android/cros/camera3_hal.cpp | 26 | ||||
-rw-r--r-- | src/android/cros/meson.build | 13 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/android/cros/camera3_hal.cpp b/src/android/cros/camera3_hal.cpp new file mode 100644 index 00000000..6010a5ad --- /dev/null +++ b/src/android/cros/camera3_hal.cpp @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2021, Google Inc. + * + * cros-specific components of Android Camera HALv3 module + */ + +#include <cros-camera/cros_camera_hal.h> + +#include "../camera_hal_manager.h" +#include "../cros_mojo_token.h" + +static void set_up(cros::CameraMojoChannelManagerToken *token) +{ + gCrosMojoToken = token; +} + +static void tear_down() +{ + delete CameraHalManager::instance(); +} + +cros::cros_camera_hal_t CROS_CAMERA_EXPORT CROS_CAMERA_HAL_INFO_SYM = { + .set_up = set_up, + .tear_down = tear_down +}; diff --git a/src/android/cros/meson.build b/src/android/cros/meson.build new file mode 100644 index 00000000..35995dd8 --- /dev/null +++ b/src/android/cros/meson.build @@ -0,0 +1,13 @@ +# SPDX-License-Identifier: CC0-1.0 + +if get_option('android_platform') != 'cros' + subdir_done() +endif + +android_hal_sources += files([ + 'camera3_hal.cpp', +]) + +android_deps += dependency('libcros_camera') + +android_cpp_args += ['-DOS_CHROMEOS'] |