aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--camera/Android.bp26
-rw-r--r--camera/libpiex_shim.cpp17
-rw-r--r--device.mk5
-rwxr-xr-xextract-files.sh3
4 files changed, 49 insertions, 2 deletions
diff --git a/camera/Android.bp b/camera/Android.bp
new file mode 100644
index 0000000..421e3b3
--- /dev/null
+++ b/camera/Android.bp
@@ -0,0 +1,26 @@
+//
+// Copyright (C) 2020 The LineageOS Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_library_shared {
+ name: "libpiex_shim",
+
+ shared_libs: [
+ "libpiex",
+ "libutils",
+ ],
+
+ proprietary: true,
+ srcs: ["libpiex_shim.cpp"],
+} \ No newline at end of file
diff --git a/camera/libpiex_shim.cpp b/camera/libpiex_shim.cpp
new file mode 100644
index 0000000..2ce9e19
--- /dev/null
+++ b/camera/libpiex_shim.cpp
@@ -0,0 +1,17 @@
+#include <src/piex.h>
+
+namespace piex {
+
+using image_type_recognition::RawImageTypes;
+
+extern "C" void
+ _ZN4piex19GetPreviewImageDataEPNS_15StreamInterfaceEPNS_16PreviewImageDataEPNS_22image_type_recognition13RawImageTypesE(
+ StreamInterface* data, PreviewImageData* preview_image_data, RawImageTypes* output_type);
+
+
+extern "C" void _ZN4piex19GetPreviewImageDataEPNS_15StreamInterfaceEPNS_16PreviewImageDataE(
+ StreamInterface* data, PreviewImageData* preview_image_data) {
+ return _ZN4piex19GetPreviewImageDataEPNS_15StreamInterfaceEPNS_16PreviewImageDataEPNS_22image_type_recognition13RawImageTypesE(data, preview_image_data, nullptr);
+}
+
+} // namespace piex \ No newline at end of file
diff --git a/device.mk b/device.mk
index 8625dd7..2d61d73 100644
--- a/device.mk
+++ b/device.mk
@@ -116,7 +116,10 @@ PRODUCT_PACKAGES += \
vendor.qti.hardware.camera.device@1.0.vendor \
vendor.qti.hardware.camera.postproc@1.0.vendor
-# Component Overrides
+PRODUCT_PACKAGES += \
+ libpiex_shim
+
+# Component overrides
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/configs/component-overrides.xml:$(TARGET_COPY_OUT_VENDOR)/etc/sysconfig/component-overrides.xml
diff --git a/extract-files.sh b/extract-files.sh
index 96e4a74..7876bef 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -53,7 +53,8 @@ function blob_fixup() {
case "${1}" in
vendor/lib64/camera/components/com.qti.node.mialgocontrol.so)
llvm-strip --strip-debug "${2}"
- ;;
+ "${PATCHELF}" --add-needed "libpiex_shim.so" "${2}"
+ ;;
esac
}