From 6401b33c1aea8be52cf4f4ae0f031905ac1da842 Mon Sep 17 00:00:00 2001 From: pjgowtham Date: Mon, 23 Nov 2026 22:27:53 +0530 Subject: [PATCH] ferrari: Enable Oplus camera extensions Take the extensions, the camera unit SDK they drive and its sepolicy from vendor/oplus/camera, and declare Night and Bokeh on the main camera in camera_unit_config, which predates the SDK's cameraExtensionConfig. Pin the Night preview sizes, as newer Oplus devices do, since the SDK otherwise derives portrait oriented ones from the screen and CameraX finds no output size. The rear portrait preview is configured for two cameras, but an extension session has a single stream, so APS rejects every frame ("dispatchInputData() undefined case!!") and the viewfinder stays black. Configure it for one camera. Front Night is left out: the HAL aborts on the capture request. Assisted-by: LLM Change-Id: Iecbc00963d94c3f13a01a91f218b2ea10d08e443 --- BoardConfig.mk | 3 +++ device.mk | 3 +++ extract-files.py | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/BoardConfig.mk b/BoardConfig.mk index 81bd5dc..1bdfe6d 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -9,6 +9,9 @@ include device/oneplus/sm8450-common/BoardConfigCommon.mk DEVICE_PATH := device/realme/ferrari +# Camera +include vendor/oplus/camera/BoardConfigVendor.mk + # HIDL DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/manifest.xml diff --git a/device.mk b/device.mk index d4702e7..7823017 100644 --- a/device.mk +++ b/device.mk @@ -26,6 +26,9 @@ PRODUCT_COPY_FILES += \ TARGET_SCREEN_HEIGHT := 3216 TARGET_SCREEN_WIDTH := 1440 +# Camera +$(call inherit-product, vendor/oplus/camera/camera-vendor.mk) + # Display PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/configs/display/displayconfig.xml:$(TARGET_COPY_OUT_VENDOR)/etc/displayconfig/display_id_4630946358012694402.xml diff --git a/extract-files.py b/extract-files.py index 79a8d0a..643d88d 100755 --- a/extract-files.py +++ b/extract-files.py @@ -80,6 +80,14 @@ blob_fixups: blob_fixups_user_type = { 'odm/etc/camera/CameraHWConfiguration.config': blob_fixup() .regex_replace('SystemCamera = 0; 0; 1; 1; 1', 'SystemCamera = 0; 0; 0; 0; 1') .regex_replace('SystemCamera = com.oplus.camera', 'SystemCamera = org.lineageos.aperture'), + 'odm/etc/camera/config/camera_unit_config': blob_fixup() + .regex_replace('^{', '{\n "cameraExtensionConfig":[\n' + ' {"type":4, "cameraId":"0", "support_ratio":"standard,16_9", "format":"256,35", "specific_preview_ratio_size":{"standard":"1440x1080", "16_9":"1920x1080"}, "capture_latency_range":"100,7000"},\n' + ' {"type":2, "cameraId":"0", "support_ratio":"standard", "format":"256,35", "capture_latency_range":"100,10000"}\n' + ' ],\n'), + 'odm/etc/camera/config/oplus_camera_algo_switch_config': blob_fixup() + .regex_replace(r'(?s)("mode": "portrait",\s*"entity": \[\s*\{\s*"id": 0,\s*"camera_num": )2(.*?"slave_input_width": )1440(,\s*"slave_input_height": )1080(.*?"algo_list": \[ )"preview_rtb", "preview_aicolor", ("preview_lsd" \])', + r'\g<1>1\g<2>0\g<3>0\g<4>\g<5>'), 'odm/lib64/libAlgoProcess.so': blob_fixup() .replace_needed('android.hardware.graphics.common-V2-ndk_platform.so', 'android.hardware.graphics.common-V7-ndk.so'), ('odm/lib64/libCOppLceTonemapAPI.so', 'odm/lib64/libSuperRaw.so', 'odm/lib64/libYTCommon.so', 'odm/lib64/libaps_frame_registration.so'): blob_fixup()