From ee57f80147dfeb0a2c2a9724294ff01d20b740d3 Mon Sep 17 00:00:00 2001 From: Erfan Abdi Date: Sun, 8 Sep 2019 15:04:55 +0430 Subject: sdm660-common: Make shim for libcamera.sdm660.so P: GraphicBuffer::lock(uint32_t inUsage, void** vaddr); Q: GraphicBuffer::lock(uint32_t inUsage, void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); Error: cannot locate symbol "_ZN7android13GraphicBuffer4lockEjPPv" referenced by "/vendor/lib/hw/camera.sdm660.so" Change-Id: I1c1fe66f3f73149ced601eae87b970ce392d50ee --- extract-files.sh | 1 + libshims/Android.mk | 9 +++++++++ libshims/camera_sdm660_shim.cpp | 9 +++++++++ sdm660.mk | 4 ++++ 4 files changed, 23 insertions(+) create mode 100644 libshims/Android.mk create mode 100644 libshims/camera_sdm660_shim.cpp diff --git a/extract-files.sh b/extract-files.sh index 8528cec..c50bac1 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -73,6 +73,7 @@ function blob_fixup() { vendor/lib/hw/camera.sdm660.so) patchelf --replace-needed libMiWatermark.so libMiWatermark_shim.so "${2}" + patchelf --add-needed libcamera_sdm660_shim.so "${2}" ;; esac } diff --git a/libshims/Android.mk b/libshims/Android.mk new file mode 100644 index 0000000..ce2b87e --- /dev/null +++ b/libshims/Android.mk @@ -0,0 +1,9 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) +LOCAL_SRC_FILES := camera_sdm660_shim.cpp +LOCAL_SHARED_LIBRARIES := libui libutils +LOCAL_MODULE := libcamera_sdm660_shim +LOCAL_MODULE_TAGS := optional +LOCAL_PROPRIETARY_MODULE := true +include $(BUILD_SHARED_LIBRARY) diff --git a/libshims/camera_sdm660_shim.cpp b/libshims/camera_sdm660_shim.cpp new file mode 100644 index 0000000..c18e5a4 --- /dev/null +++ b/libshims/camera_sdm660_shim.cpp @@ -0,0 +1,9 @@ +#include + +namespace android { + extern "C" void _ZN7android13GraphicBuffer4lockEjPPvPiS3_(uint32_t inUsage, void** vaddr, int32_t* outBytesPerPixel, int32_t* outBytesPerStride); + + extern "C" void _ZN7android13GraphicBuffer4lockEjPPv(uint32_t inUsage, void** vaddr) { + _ZN7android13GraphicBuffer4lockEjPPvPiS3_(inUsage, vaddr, nullptr, nullptr); + } +} diff --git a/sdm660.mk b/sdm660.mk index f5a3ef9..7c8d793 100644 --- a/sdm660.mk +++ b/sdm660.mk @@ -389,6 +389,10 @@ PRODUCT_COPY_FILES += \ $(COMMON_PATH)/sensors/hals.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/hals.conf \ $(COMMON_PATH)/sensors/sensor_def_qcomdev.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/sensor_def_qcomdev.conf +# Shims +PRODUCT_PACKAGES += \ + libcamera_sdm660_shim + # Tetheroffload PRODUCT_PACKAGES += \ ipacm \ -- cgit v1.2.3