From f3476792131f1b6d8d267f8ad83639fd8e3f22a2 Mon Sep 17 00:00:00 2001 From: pjgowtham Date: Sat, 7 Nov 2026 10:21:12 +0530 Subject: [PATCH] ferrari: Enable Oplus camera extensions Ship the extensions bridge 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 --- device.mk | 4 ++++ extract-files.py | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/device.mk b/device.mk index d4702e7..502bcb2 100644 --- a/device.mk +++ b/device.mk @@ -26,6 +26,10 @@ PRODUCT_COPY_FILES += \ TARGET_SCREEN_HEIGHT := 3216 TARGET_SCREEN_WIDTH := 1440 +# Camera +PRODUCT_PACKAGES += \ + androidx.camera.extensions.impl.oplus + # 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()