mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 12:35:33 -04:00
universal7885: Add libcorrectcamera shim
* Supposed to map camera ID 2's info to camera ID 1 Change-Id: I154b0a3357ac689530f53dbf4d251aa7f60c6a2f Signed-off-by: roynatech2544 <whiteshell2544@naver.com>
This commit is contained in:
parent
aa3a35f830
commit
e9d83bf897
3 changed files with 85 additions and 1 deletions
35
universal7885-common/libshims/camera/Android.bp
Normal file
35
universal7885-common/libshims/camera/Android.bp
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Eureka Team.
|
||||||
|
* https://github.com/eurekadevelopment
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
cc_library_shared {
|
||||||
|
name: "libcorrectcamera",
|
||||||
|
defaults: ["hidl_defaults"],
|
||||||
|
proprietary: true,
|
||||||
|
srcs: [
|
||||||
|
"CorrectCameraID.cpp",
|
||||||
|
],
|
||||||
|
shared_libs: [
|
||||||
|
"libhidlbase",
|
||||||
|
"libhardware",
|
||||||
|
"camera.device@3.2-impl",
|
||||||
|
"libcamera_metadata",
|
||||||
|
"android.hardware.camera.device@3.2",
|
||||||
|
"android.hardware.camera.provider@2.4",
|
||||||
|
"android.hardware.graphics.mapper@2.0",
|
||||||
|
"android.hardware.graphics.mapper@3.0",
|
||||||
|
"android.hardware.graphics.mapper@4.0",
|
||||||
|
"liblog",
|
||||||
|
"libutils",
|
||||||
|
"libcutils",
|
||||||
|
],
|
||||||
|
static_libs: [
|
||||||
|
"android.hardware.camera.common@1.0-helper",
|
||||||
|
],
|
||||||
|
}
|
||||||
48
universal7885-common/libshims/camera/CorrectCameraID.cpp
Normal file
48
universal7885-common/libshims/camera/CorrectCameraID.cpp
Normal file
|
|
@ -0,0 +1,48 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022 Eureka Team.
|
||||||
|
* https://github.com/eurekadevelopment
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "CameraDevice_3_2.h"
|
||||||
|
#include <include/convert.h>
|
||||||
|
#include <log/log.h>
|
||||||
|
|
||||||
|
namespace android {
|
||||||
|
namespace hardware {
|
||||||
|
namespace camera {
|
||||||
|
namespace device {
|
||||||
|
namespace V3_2 {
|
||||||
|
namespace implementation {
|
||||||
|
|
||||||
|
using ::android::hardware::camera::common::V1_0::Status;
|
||||||
|
|
||||||
|
Return<void> CameraDevice::getCameraCharacteristics(ICameraDevice::getCameraCharacteristics_cb _hidl_cb) {
|
||||||
|
Status status = initStatus();
|
||||||
|
CameraMetadata cameraCharacteristics;
|
||||||
|
if (status == Status::OK) {
|
||||||
|
//Module 2.1+ codepath.
|
||||||
|
struct camera_info info;
|
||||||
|
if (mCameraIdInt == 2) mCameraIdInt = 1;
|
||||||
|
int ret = mModule->getCameraInfo(mCameraIdInt, &info);
|
||||||
|
if (ret == OK) {
|
||||||
|
convertToHidl(info.static_camera_characteristics, &cameraCharacteristics);
|
||||||
|
} else {
|
||||||
|
ALOGE("%s: get camera info failed!", __FUNCTION__);
|
||||||
|
status = Status::INTERNAL_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_hidl_cb(status, cameraCharacteristics);
|
||||||
|
return Void();
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace implementation
|
||||||
|
} // namespace V3_2
|
||||||
|
} // namespace device
|
||||||
|
} // namespace camera
|
||||||
|
} // namespace hardware
|
||||||
|
} // namespace android
|
||||||
|
|
@ -283,7 +283,8 @@ PRODUCT_PACKAGES += \
|
||||||
|
|
||||||
# Shims
|
# Shims
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
libshim_sensorndkbridge
|
libshim_sensorndkbridge \
|
||||||
|
libcorrectcamera
|
||||||
|
|
||||||
# Skip Mount
|
# Skip Mount
|
||||||
PRODUCT_PACKAGES += \
|
PRODUCT_PACKAGES += \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue