Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54db4b9a authored by Daniel Jacob Chittoor's avatar Daniel Jacob Chittoor Committed by Mohammed Althaf T
Browse files

CameraController: Conditionalize FP scaler for FP4

parent 13c9e79d
Loading
Loading
Loading
Loading
+19 −14
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public class CameraController2 extends CameraController {
    private final String cameraIdS; // ID string of logical camera
    private final String cameraIdSPhysical; // if non-null, ID string of underlying physical camera

    private final boolean is_fairphone_4;
    private final boolean is_samsung;
    private final boolean is_samsung_s7; // Galaxy S7 or Galaxy S7 Edge
    private final boolean is_samsung_galaxy_s;
@@ -2108,11 +2109,13 @@ public class CameraController2 extends CameraController {
        this.camera_error_cb = camera_error_cb;

        //this.is_oneplus = Build.MANUFACTURER.toLowerCase(Locale.US).contains("oneplus");
        this.is_fairphone_4 = Build.MODEL.toLowerCase(Locale.US).contains("fp4");
        this.is_samsung = Build.MANUFACTURER.toLowerCase(Locale.US).contains("samsung");
        this.is_samsung_s7 = Build.MODEL.toLowerCase(Locale.US).contains("sm-g93");
        this.is_samsung_galaxy_s = is_samsung && ( Build.MODEL.toLowerCase(Locale.US).contains("sm-g") || Build.MODEL.toLowerCase(Locale.US).contains("sm-s") );
        this.is_samsung_galaxy_f = is_samsung && Build.MODEL.toLowerCase(Locale.US).contains("sm-f");
        if( MyDebug.LOG ) {
            Log.d(TAG, "is_fairphone_4: " + is_fairphone_4);
            Log.d(TAG, "is_samsung: " + is_samsung);
            Log.d(TAG, "is_samsung_s7: " + is_samsung_s7);
            Log.d(TAG, "is_samsung_galaxy_s: " + is_samsung_galaxy_s);
@@ -3072,6 +3075,7 @@ public class CameraController2 extends CameraController {
            }
        }

        if (is_fairphone_4) {
            CameraCharacteristics.Key<int[]> fairphoneAvailableStreamConfigurations = null;

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
@@ -3092,6 +3096,7 @@ public class CameraController2 extends CameraController {
                    camera_features.picture_sizes.add(new Size(width, height));
                }
            }
        }

        // sizes are usually already sorted from high to low, but sort just in case
        // note some devices do have sizes in a not fully sorted order (e.g., Nokia 8)