From 485875b0a891a6a2541ed4bfd4afcc72ae5ff925 Mon Sep 17 00:00:00 2001 From: Mattijs Korpershoek Date: Wed, 19 Feb 2025 17:17:08 +0100 Subject: [PATCH] android: camera3_hal: Add stubs for CAMERA_MODULE_API_VERSION_2_5 CAMERA_MODULE_API_VERSION_2_5 provides new functions such as isStreamCombinationSupported(). isStreamCombinationSupported() is tested by VtsAidlHalCameraProvider_TargetTest Add stubs for implementing these to fix more VTS. Signed-off-by: Mattijs Korpershoek --- src/android/camera3_hal.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp index a5ad2374..4fe4cec7 100644 --- a/src/android/camera3_hal.cpp +++ b/src/android/camera3_hal.cpp @@ -65,6 +65,24 @@ static int hal_init() return 0; } +static int hal_get_physical_camera_info([[maybe_unused]] int physical_camera_id, + [[maybe_unused]] camera_metadata_t **static_metadata) +{ + return 0; +} + + +static int hal_is_stream_combination_supported([[maybe_unused]] int camera_id, + [[maybe_unused]] const camera_stream_combination_t *streams) +{ + return 0; +} + +static void hal_notify_device_state_change([[maybe_unused]] uint64_t deviceState) +{ + return; +} + /*------------------------------------------------------------------------------ * Android Camera Device */ @@ -95,7 +113,7 @@ static struct hw_module_methods_t hal_module_methods = { camera_module_t HAL_MODULE_INFO_SYM = { .common = { .tag = HARDWARE_MODULE_TAG, - .module_api_version = CAMERA_MODULE_API_VERSION_2_4, + .module_api_version = CAMERA_MODULE_API_VERSION_2_5, .hal_api_version = HARDWARE_HAL_API_VERSION, .id = CAMERA_HARDWARE_MODULE_ID, .name = "libcamera camera HALv3 module", @@ -112,5 +130,8 @@ camera_module_t HAL_MODULE_INFO_SYM = { .open_legacy = hal_open_legacy, .set_torch_mode = hal_set_torch_mode, .init = hal_init, + .get_physical_camera_info = hal_get_physical_camera_info, + .is_stream_combination_supported = hal_is_stream_combination_supported, + .notify_device_state_change = hal_notify_device_state_change, .reserved = {}, };