From d4185a6107dfe9657f65d3c10c1fdef0298a6f94 Mon Sep 17 00:00:00 2001 From: Daniel Jacob Chittoor Date: Mon, 21 Jul 2025 22:35:57 +0530 Subject: [PATCH] CameraController2: Add FP6 specific characteristic for high res * Extend https://gitlab.e.foundation/e/os/camera/-/commit/dbd8d1bbdbafbfd57a717c167f44c9f1e7f72f43 for FP6 Co-authored-by: Rohit Sekhar --- .../cameracontroller/CameraController2.java | 40 ++++++++++++------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/net/sourceforge/opencamera/cameracontroller/CameraController2.java b/app/src/main/java/net/sourceforge/opencamera/cameracontroller/CameraController2.java index d0abeb0b0..1cdb33042 100644 --- a/app/src/main/java/net/sourceforge/opencamera/cameracontroller/CameraController2.java +++ b/app/src/main/java/net/sourceforge/opencamera/cameracontroller/CameraController2.java @@ -2915,23 +2915,33 @@ public class CameraController2 extends CameraController { } } - if(is_fairphone && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - CameraCharacteristics.Key qcfaDimensionKey = - new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.quadra_cfa.qcfa_dimension", int[].class); - try { - int[] qcfaDimension = characteristics.get(qcfaDimensionKey); - if (qcfaDimension != null && qcfaDimension.length == 2) { - int qcfaWidth = qcfaDimension[0]; - int qcfaHeight = qcfaDimension[1]; - Size qcfaSize = new Size(qcfaWidth, qcfaHeight); - if (!camera_features.picture_sizes.contains(qcfaSize)) { - if (MyDebug.LOG) - Log.d(TAG, "Adding QCFA size: " + qcfaWidth + " x " + qcfaHeight); - camera_features.picture_sizes.add(qcfaSize); + if (is_fairphone && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + CameraCharacteristics.Key[] customDimensionKeys = new CameraCharacteristics.Key[] { + new CameraCharacteristics.Key<>("org.codeaurora.qcamera3.quadra_cfa.qcfa_dimension", int[].class), + new CameraCharacteristics.Key<>("com.fp.device.capabilities.sensor.highresolution", int[].class) + }; + + String[] keyLabels = new String[] { + "QCFA size (legacy)", + "High-resolution size" + }; + + for (int i = 0; i < customDimensionKeys.length; i++) { + try { + int[] dimension = characteristics.get(customDimensionKeys[i]); + if (dimension != null && dimension.length == 2) { + int width = dimension[0]; + int height = dimension[1]; + Size size = new Size(width, height); + if (!camera_features.picture_sizes.contains(size)) { + if (MyDebug.LOG) + Log.d(TAG, "Adding " + keyLabels[i] + ": " + width + " x " + height); + camera_features.picture_sizes.add(size); + } } + } catch (IllegalArgumentException e) { + e.printStackTrace(); } - } catch (IllegalArgumentException e) { - e.printStackTrace(); } } -- GitLab