diff --git a/Android.bp b/Android.bp index 6213448..28889b4 100644 --- a/Android.bp +++ b/Android.bp @@ -296,6 +296,24 @@ cc_library { vendor: true } +cc_library_shared { + name: "libcamera_provider_shim", + shared_libs: [ + "camera.device@1.0-impl", + "camera.device@3.2-impl", + "camera.device@3.3-impl", + "camera.device@3.4-impl", + "camera.device@3.5-impl", + "libcamera_metadata", + ], + include_dirs: [ + "hardware/interfaces/camera/common/default/include/", + "hardware/libhardware/include", + ], + srcs: ["libcamera_provider/camera_provider.cpp"], + vendor: true, +} + cc_prebuilt_library_shared { name: "libcrypto-v33", vendor: true, diff --git a/libcamera_provider/camera_provider.cpp b/libcamera_provider/camera_provider.cpp new file mode 100644 index 0000000..e499567 --- /dev/null +++ b/libcamera_provider/camera_provider.cpp @@ -0,0 +1,81 @@ +/* + * Copyright (C) 2024 The LineageOS Project + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "CameraModule.h" + +using android::SortedVector; +using android::sp; +using android::hardware::camera::common::helper::CameraModule; + +// android::hardare::camera::device::V1_0 +extern "C" void* +_ZN7android8hardware6camera6device4V1_014implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector); + +extern "C" void* +_ZN7android8hardware6camera6device4V1_014implementation12CameraDeviceC1ENS_2spINS1_6common4V1_06helper12CameraModuleEEERKNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEERKNS_12SortedVectorINSC_4pairISI_SI_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector) { + return _ZN7android8hardware6camera6device4V1_014implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + thisptr, cameraModule, str, sortedVector); +} + +// android::hardware::camera::device::V3_2 +extern "C" void* +_ZN7android8hardware6camera6device4V3_214implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector); + +extern "C" void* +_ZN7android8hardware6camera6device4V3_214implementation12CameraDeviceC1ENS_2spINS1_6common4V1_06helper12CameraModuleEEERKNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEERKNS_12SortedVectorINSC_4pairISI_SI_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector) { + return _ZN7android8hardware6camera6device4V3_214implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + thisptr, cameraModule, str, sortedVector); +} + +// android::hardware::camera::device::V3_3 +extern "C" void* +_ZN7android8hardware6camera6device4V3_314implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector); + +extern "C" void* +_ZN7android8hardware6camera6device4V3_314implementation12CameraDeviceC1ENS_2spINS1_6common4V1_06helper12CameraModuleEEERKNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEERKNS_12SortedVectorINSC_4pairISI_SI_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector) { + return _ZN7android8hardware6camera6device4V3_314implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + thisptr, cameraModule, str, sortedVector); +} + +// android::hardware::camera::device::V3_4 +extern "C" void* +_ZN7android8hardware6camera6device4V3_414implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector); + +extern "C" void* +_ZN7android8hardware6camera6device4V3_414implementation12CameraDeviceC1ENS_2spINS1_6common4V1_06helper12CameraModuleEEERKNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEERKNS_12SortedVectorINSC_4pairISI_SI_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector) { + return _ZN7android8hardware6camera6device4V3_414implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + thisptr, cameraModule, str, sortedVector); +} + +// android::hardware::camera::device::V3_5 +extern "C" void* +_ZN7android8hardware6camera6device4V3_514implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector); + +extern "C" void* +_ZN7android8hardware6camera6device4V3_514implementation12CameraDeviceC1ENS_2spINS1_6common4V1_06helper12CameraModuleEEERKNSt3__112basic_stringIcNSC_11char_traitsIcEENSC_9allocatorIcEEEERKNS_12SortedVectorINSC_4pairISI_SI_EEEE( + void* thisptr, const sp& cameraModule, const std::string& str, + const SortedVector>& sortedVector) { + return _ZN7android8hardware6camera6device4V3_514implementation12CameraDeviceC1ENS_2spINS1_6common6helper12CameraModuleEEERKNSt3__112basic_stringIcNSB_11char_traitsIcEENSB_9allocatorIcEEEERKNS_12SortedVectorINSB_4pairISH_SH_EEEE( + thisptr, cameraModule, str, sortedVector); +}