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

Commit d44895ab authored by Mark Harman's avatar Mark Harman
Browse files

Support CONTROL_ZOOM_RATIO.

parent 55133cde
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ FIXED Granting only approximate location permission on Android 12 would turn g
FIXED   On-screen text looked strange on Android 12.
FIXED   Gallery icon overlapped with navigation bar if using widescreen resolution with UI in left
        or right handed mode.
ADDED   Improved support for devices with multiple camera devices, where extra cameras are exposed
        via zooming in and out (e.g., Pixel 5/6).
ADDED   New debug option Settings/Photo settings/"Enable dummy capture HDR/expo fix". Please enable
        this if you are having problems with HDR or expo bracketing mode on Samsung Galaxy devices
        with Android 11+ (specifically if some expo images come out with the same exposures).
+1 −2
Original line number Diff line number Diff line
@@ -2519,9 +2519,8 @@ public class MainActivity extends AppCompatActivity {
        bundle.putBoolean("supports_photo_video_recording", this.preview.supportsPhotoVideoRecording());
        bundle.putFloat("camera_view_angle_x", preview.getViewAngleX(false));
        bundle.putFloat("camera_view_angle_y", preview.getViewAngleY(false));
        bundle.putFloat("min_zoom_factor", preview.getMinZoomRatio());
        bundle.putFloat("max_zoom_factor", preview.getMaxZoomRatio());
        bundle.putFloat("zoom_ratio_low", preview.getZoomRatioLow());
        bundle.putFloat("zoom_ratio_high", preview.getZoomRatioHigh());

        putBundleExtra(bundle, "color_effects", this.preview.getSupportedColorEffects());
        putBundleExtra(bundle, "scene_modes", this.preview.getSupportedSceneModes());
+2 −2
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ public class MyApplicationInterface extends BasicApplicationInterface {
    private final static float aperture_default = -1.0f;
    private float aperture = aperture_default;
    // camera properties that aren't saved even in the bundle; these should be initialised/reset in reset()
    private int zoom_factor; // don't save zoom, as doing so tends to confuse users; other camera applications don't seem to save zoom when pause/resuming
    private int zoom_factor = -1; // don't save zoom, as doing so tends to confuse users; other camera applications don't seem to save zoom when pause/resuming

    // for testing:
    public volatile int test_n_videos_scanned;
@@ -3063,7 +3063,7 @@ public class MyApplicationInterface extends BasicApplicationInterface {
            // aperture is reset when switching camera, but not when application is paused or switching between photo/video etc
            this.aperture = aperture_default;
        }
        this.zoom_factor = 0;
        this.zoom_factor = -1;
    }

    @Override
+3 −3
Original line number Diff line number Diff line
@@ -114,9 +114,8 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
        if( MyDebug.LOG )
            Log.d(TAG, "camera_orientation: " + camera_orientation);

        final float min_zoom_factor = bundle.getFloat("min_zoom_factor");
        final float max_zoom_factor = bundle.getFloat("max_zoom_factor");
        final float zoom_ratio_low = bundle.getFloat("zoom_ratio_low");
        final float zoom_ratio_high = bundle.getFloat("zoom_ratio_high");

        final SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this.getActivity());

@@ -1206,9 +1205,10 @@ public class MyPreferenceFragment extends PreferenceFragment implements OnShared
                                about_string.append(last_video_error);
                            }
                        }
                        about_string.append("\nMin zoom factor: ");
                        about_string.append(min_zoom_factor);
                        about_string.append("\nMax zoom factor: ");
                        about_string.append(max_zoom_factor);
                        about_string.append("\nZoom ratio range: " + zoom_ratio_low + " , " + zoom_ratio_high);
                        if( preview_widths != null && preview_heights != null ) {
                            about_string.append("\nPreview resolutions: ");
                            for(int i=0;i<preview_widths.length;i++) {
+1 −3
Original line number Diff line number Diff line
@@ -61,9 +61,6 @@ public abstract class CameraController {
        public boolean is_zoom_supported;
        public int max_zoom;
        public List<Integer> zoom_ratios;
        public boolean has_zoom_ratio_range; // for multi-camera zoom
        public float zoom_ratio_low;
        public float zoom_ratio_high;
        public boolean supports_face_detection;
        public List<CameraController.Size> picture_sizes;
        public List<CameraController.Size> video_sizes;
@@ -506,6 +503,7 @@ public abstract class CameraController {
    public abstract void setJpegQuality(int quality);
    public abstract int getZoom();
    public abstract void setZoom(int value);
    public abstract void resetZoom(); // resets to zoom 1x
    public abstract int getExposureCompensation();
    public abstract boolean setExposureCompensation(int new_exposure);
    public abstract void setPreviewFpsRange(int min, int max);
Loading