Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

[camera] Fix all capture timeout, autofocus, flash, exposure, and device crash issues #3651

Closed
wants to merge 144 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
7f5355b
More refactoring
acoutts Feb 28, 2021
6348e23
Tweaks
acoutts Mar 1, 2021
a698fe8
Can now capture repeated images with no AF but with AE working
acoutts Mar 1, 2021
22887fe
Reduce capture delay and preview lag while capturing by providing pre…
acoutts Mar 1, 2021
9b74bc4
Can't fix delay on pixel yet
acoutts Mar 1, 2021
ac72eb8
Focus lock works now for image capture
acoutts Mar 1, 2021
2f19f1f
Photo capture works in focus auto/locked state now
acoutts Mar 1, 2021
b9f1799
Setting exposure mode works now
acoutts Mar 1, 2021
c0bcbb5
Cleanup
acoutts Mar 1, 2021
2c5f616
Flash working now
acoutts Mar 1, 2021
047d44a
Stop background thread when camera is closed
acoutts Mar 1, 2021
c591424
Dont cleanup background thread until cameras topped
acoutts Mar 1, 2021
31f7b18
Make sure to set focus mode idle
acoutts Mar 1, 2021
1cb86e8
Add nv21 image format for android
acoutts Mar 1, 2021
a36f1f0
Unit tests passing and capture timeout works again
acoutts Mar 1, 2021
aada63c
Remove comments and clean things up
acoutts Mar 1, 2021
ebaba7a
Cleanup
acoutts Mar 1, 2021
6e7a356
Cleanup unused
acoutts Mar 1, 2021
d87da41
Bump version of platform interface
acoutts Mar 1, 2021
cbadf8f
Merge remote-tracking branch 'upstream/master' into android-rework
acoutts Mar 1, 2021
9302540
Clean up imports
acoutts Mar 2, 2021
67af065
Handle LENS_INFO_MINIMUM_FOCUS_DISTANCE being null
acoutts Mar 2, 2021
6b110e1
Cleanup
acoutts Mar 2, 2021
7da87ea
Formatting
acoutts Mar 2, 2021
d26b9f2
Remove log
acoutts Mar 2, 2021
c88bc92
Reduce overhead for capture requests and streaming by only requesting…
acoutts Mar 2, 2021
8d13496
Cleanup
acoutts Mar 2, 2021
a964f4c
Remove nv21
acoutts Mar 2, 2021
354991f
Added a (not working yet) unit test trying to mock camera characteris…
acoutts Mar 2, 2021
9a08980
Update changelog to remove NV21 references.
acoutts Mar 2, 2021
194bf82
Merge remote-tracking branch 'upstream/master' into android-rework
acoutts Mar 2, 2021
52bce5c
More refactoring
acoutts Feb 28, 2021
2c70c07
Tweaks
acoutts Mar 1, 2021
e083051
Can now capture repeated images with no AF but with AE working
acoutts Mar 1, 2021
0f23f3a
Reduce capture delay and preview lag while capturing by providing pre…
acoutts Mar 1, 2021
5dbd500
Can't fix delay on pixel yet
acoutts Mar 1, 2021
04d0476
Focus lock works now for image capture
acoutts Mar 1, 2021
d0514b5
Photo capture works in focus auto/locked state now
acoutts Mar 1, 2021
e1ebde4
Setting exposure mode works now
acoutts Mar 1, 2021
56fd09a
Cleanup
acoutts Mar 1, 2021
8892fb9
Flash working now
acoutts Mar 1, 2021
5a0f41b
Stop background thread when camera is closed
acoutts Mar 1, 2021
4ad0bfa
Dont cleanup background thread until cameras topped
acoutts Mar 1, 2021
3098bd4
Make sure to set focus mode idle
acoutts Mar 1, 2021
772d3f1
Add nv21 image format for android
acoutts Mar 1, 2021
9aee09c
Unit tests passing and capture timeout works again
acoutts Mar 1, 2021
03ccc22
Remove comments and clean things up
acoutts Mar 1, 2021
01edeeb
Cleanup
acoutts Mar 1, 2021
8d05deb
Cleanup unused
acoutts Mar 1, 2021
5d0e1ac
Bump version of platform interface
acoutts Mar 1, 2021
25e93cb
Clean up imports
acoutts Mar 2, 2021
2378b5e
Handle LENS_INFO_MINIMUM_FOCUS_DISTANCE being null
acoutts Mar 2, 2021
989971c
Cleanup
acoutts Mar 2, 2021
5f3b70b
Formatting
acoutts Mar 2, 2021
c9250f0
Remove log
acoutts Mar 2, 2021
cfb7a2a
Reduce overhead for capture requests and streaming by only requesting…
acoutts Mar 2, 2021
ae9e982
Cleanup
acoutts Mar 2, 2021
f5c9146
Remove nv21
acoutts Mar 2, 2021
5015330
Added a (not working yet) unit test trying to mock camera characteris…
acoutts Mar 2, 2021
02d009e
Update changelog to remove NV21 references.
acoutts Mar 2, 2021
3ff6e25
Merged with upstream master
mvanbeusekom Mar 3, 2021
2f8d774
Removed unused parameter
mvanbeusekom Mar 3, 2021
2e63379
Added missing test cases PictureCaptureRequest
mvanbeusekom Mar 3, 2021
e552379
Renamed mFile to file to match code style
mvanbeusekom Mar 3, 2021
081ba9c
Fixed all Android tests
mvanbeusekom Mar 3, 2021
358a790
Merge pull request #3 from bottlepay/android-rework-refactor-camera-c…
acoutts Mar 3, 2021
818cc0d
Merge pull request #2 from bottlepay/android-rework-picture-request-s…
acoutts Mar 3, 2021
3481c1e
Fix NRE when calling setExposureOffset
mvanbeusekom Mar 3, 2021
4a4c082
Merge pull request #4 from bottlepay/android-rework-exposure-offset-e…
acoutts Mar 3, 2021
25cff82
Fix compile error
mvanbeusekom Mar 4, 2021
dd41407
Merge branch 'android-rework' into android-rework-camera-tests
mvanbeusekom Mar 4, 2021
e7808a5
Extract CaptureCallback implementation
mvanbeusekom Mar 5, 2021
b55f2e5
Merge pull request #5 from bottlepay/android-rework-extract-capture-c…
acoutts Mar 6, 2021
902e605
Abstracted camera settings into new feature class
acoutts Mar 6, 2021
6cfd5ee
More refactoring of camera features
acoutts Mar 6, 2021
1b4432b
Refactoring
acoutts Mar 7, 2021
c06762a
Linter errors
acoutts Mar 7, 2021
445bb1c
Cleanup
acoutts Mar 7, 2021
4b0b0d8
Cleanup
acoutts Mar 7, 2021
bae2e61
Refactor orientation lock into feature and fix camera capture states
acoutts Mar 7, 2021
b1d3e1f
Update SensorOrientation.java
acoutts Mar 7, 2021
154b58c
Capturing photos works again
acoutts Mar 7, 2021
44a781e
Fixed focus lock on sony and pixel devices
acoutts Mar 7, 2021
1acf379
Merge pull request #6 from bottlepay/fix/refactoring
acoutts Mar 7, 2021
367d496
Fix tests after feature refactor
mvanbeusekom Mar 8, 2021
109ae75
Added test coverage to auto focus feature
mvanbeusekom Mar 8, 2021
3523016
Merge pull request #7 from bottlepay/android-rework-fix-tests
acoutts Mar 8, 2021
5387727
Merge pull request #8 from bottlepay/android-rework-test-autofocus-fe…
acoutts Mar 8, 2021
826c7ed
Added test coverage to exposure lock feature
mvanbeusekom Mar 8, 2021
866f823
Merge pull request #9 from bottlepay/android-rework-test-exposurelock…
acoutts Mar 8, 2021
5ea549e
Added test coverage to exposure offset feature
mvanbeusekom Mar 9, 2021
36b7249
Added test coverage to exposure point feature
mvanbeusekom Mar 9, 2021
7c701cd
Added test coverage to flash feature
mvanbeusekom Mar 9, 2021
a106307
Added test coverage to focus point feature
mvanbeusekom Mar 9, 2021
c5a9c76
Merge pull request #10 from bottlepay/android-rework-test-exposureoff…
acoutts Mar 9, 2021
1f26197
Merge pull request #11 from bottlepay/android-rework-test-exposurepoi…
acoutts Mar 9, 2021
11c5c31
Merge pull request #12 from bottlepay/android-rework-test-flash-feature
acoutts Mar 9, 2021
996973a
Merge pull request #13 from bottlepay/android-rework-test-focuspoint-…
acoutts Mar 9, 2021
17e3df6
Added test coverage to FPS range feature
mvanbeusekom Mar 9, 2021
727f2de
Merge pull request #14 from bottlepay/android-rework-test-fpsrange-fe…
acoutts Mar 9, 2021
722ad7d
Added test coverage to noise reduction feature
mvanbeusekom Mar 10, 2021
92029e3
Ensure the camera UI can handle when there's too many camera toggle o…
acoutts Mar 10, 2021
2ddc5b8
Added timeouts for focusing and metering to ensure picture capture ro…
acoutts Mar 10, 2021
8ec361f
Merge pull request #15 from bottlepay/android-rework-test-noisereduct…
acoutts Mar 10, 2021
50c8754
Factory constructor for PictureCaptureRequest and Timeout
acoutts Mar 10, 2021
819c348
Merge branch 'android-rework' of github.com:bottlepay/plugins into an…
acoutts Mar 10, 2021
944b2a7
Comments fix on picture capture request / timeout factory constructors
acoutts Mar 10, 2021
e45c958
Added test coverage to region boundries feature
mvanbeusekom Mar 10, 2021
c7c543f
Fix formatting
mvanbeusekom Mar 10, 2021
5b67428
Merge pull request #16 from bottlepay/android-rework-test-regionbound…
acoutts Mar 10, 2021
45fbc63
Added test coverage to resolution feature
mvanbeusekom Mar 10, 2021
5121bff
Merge pull request #17 from bottlepay/android-rework-test-resolution-…
acoutts Mar 10, 2021
a680529
Added test coverage to sensor orientation feature
mvanbeusekom Mar 10, 2021
800516b
Merge pull request #18 from bottlepay/android-rework-test-sensororien…
acoutts Mar 10, 2021
5238d2f
Added test coverage to zoom level feature
mvanbeusekom Mar 10, 2021
bb49606
Merge pull request #19 from bottlepay/android-rework-test-zoomlevel-f…
acoutts Mar 10, 2021
3dba3a3
Added test coverage to camera zoom class
mvanbeusekom Mar 10, 2021
1f0c872
Merge pull request #20 from bottlepay/android-rework-test-camera-zoom
acoutts Mar 10, 2021
2de1f92
Fix alignment on example app camera selection row items
acoutts Mar 10, 2021
eaaa5ef
Make sure precapture metering timeout works when metering fails to fi…
acoutts Mar 10, 2021
12c8b8c
Update comment
acoutts Mar 10, 2021
a44cdc5
Added test coverage to CameraCaptureCallback class
mvanbeusekom Mar 11, 2021
c541f2f
Fix formatting
mvanbeusekom Mar 11, 2021
c56da1a
Restructured test case
mvanbeusekom Mar 11, 2021
1339834
Removed obsolete test script
mvanbeusekom Mar 11, 2021
8c5b944
Merge pull request #21 from bottlepay/android-rework-test-camera-capt…
acoutts Mar 11, 2021
ea1d9cd
Reverted some changes that are not required
mvanbeusekom Mar 11, 2021
b45aa6a
Resolve deprecation warning
mvanbeusekom Mar 11, 2021
ba6ea36
Fix formatting warnings
mvanbeusekom Mar 11, 2021
ed2a02c
Fix deprecation warning
mvanbeusekom Mar 11, 2021
dff6b16
Renamed variables to confirm to style guide
mvanbeusekom Mar 15, 2021
cac6b1e
Formatted Camera.java
mvanbeusekom Mar 15, 2021
dc7e3e7
Merge remote-tracking branch 'upstream/master' into android-rework
mvanbeusekom Mar 15, 2021
a04e645
Test if camera calls features
mvanbeusekom Mar 15, 2021
0a344b1
Merge pull request #22 from bottlepay/android-rework-test-camera
acoutts Mar 15, 2021
455f923
organize imports
mvanbeusekom Mar 16, 2021
9bd2b2d
Merge branch 'android-rework' of github.com:bottlepay/plugins into an…
mvanbeusekom Mar 16, 2021
ffd62f2
Merge remote-tracking branch 'upstream/master' into android-rework
mvanbeusekom Mar 16, 2021
9c11397
fix formatting
mvanbeusekom Mar 16, 2021
cf1de78
missing applying uithread
tinyc0der Apr 3, 2021
dc1fd4e
handle captureSession null
tinyc0der Apr 3, 2021
95e104d
move runOnUIthread to PictureCaptureRequest class
tinyc0der Apr 5, 2021
38b0849
Merge pull request #23 from dica-solution/fix-UiThread
mvanbeusekom Apr 7, 2021
eea20e3
Fix 60fps bug on Pixel 4A preventing image capture from working
acoutts May 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/camera/camera/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.8.1

* Complete rewrite of Android plugin to fix all capture, focus, flash, and exposure issues.
* Fixed crash when opening front-facing cameras on some legacy android devices like Sony XZ.
* Android Flash mode works with full precapture sequence.

## 0.8.0

* Stable null safety release.
Expand Down
2 changes: 1 addition & 1 deletion packages/camera/camera/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
dependencies {
compileOnly 'androidx.annotation:annotation:1.1.0'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.5.13'
testImplementation 'org.mockito:mockito-inline:3.5.13'
testImplementation 'androidx.test:core:1.3.0'
testImplementation 'org.robolectric:robolectric:4.3'
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.camera;

import android.hardware.camera2.CameraCaptureSession;
import android.hardware.camera2.CameraCaptureSession.CaptureCallback;
import android.hardware.camera2.CaptureRequest;
import android.hardware.camera2.CaptureResult;
import android.hardware.camera2.TotalCaptureResult;
import android.util.Log;
import androidx.annotation.NonNull;

class CameraCaptureCallback extends CaptureCallback {
private final CameraCaptureStateListener cameraStateListener;
private CameraState cameraState;
private PictureCaptureRequest pictureCaptureRequest;

private CameraCaptureCallback(@NonNull CameraCaptureStateListener cameraStateListener) {
cameraState = CameraState.STATE_PREVIEW;
this.cameraStateListener = cameraStateListener;
}

public static CameraCaptureCallback create(
@NonNull CameraCaptureStateListener cameraStateListener) {
return new CameraCaptureCallback(cameraStateListener);
}

public CameraState getCameraState() {
return cameraState;
}

public void setCameraState(@NonNull CameraState state) {
cameraState = state;
}

public void setPictureCaptureRequest(@NonNull PictureCaptureRequest pictureCaptureRequest) {
this.pictureCaptureRequest = pictureCaptureRequest;
}

private void process(CaptureResult result) {
Integer aeState = result.get(CaptureResult.CONTROL_AE_STATE);
Integer afState = result.get(CaptureResult.CONTROL_AF_STATE);

if (cameraState != CameraState.STATE_PREVIEW) {
Log.i(
"Camera",
"CameraCaptureCallback | state: "
+ cameraState
+ " | afState: "
+ afState
+ " | aeState: "
+ aeState);
}

switch (cameraState) {
case STATE_PREVIEW:
{
// We have nothing to do when the camera preview is working normally.
break;
}
case STATE_WAITING_FOCUS:
{
if (afState == null) {
return;
} else if (afState == CaptureResult.CONTROL_AF_STATE_FOCUSED_LOCKED
|| afState == CaptureResult.CONTROL_AF_STATE_NOT_FOCUSED_LOCKED) {
handleWaitingFocusState(aeState);
} else if (pictureCaptureRequest != null
&& pictureCaptureRequest.preCaptureFocusing.getIsExpired()) {
Log.w("Camera", "Focus timeout, moving on with capture");
handleWaitingFocusState(aeState);
}

break;
}
case STATE_WAITING_PRECAPTURE_START:
{
// CONTROL_AE_STATE can be null on some devices
if (aeState == null
|| aeState == CaptureResult.CONTROL_AE_STATE_CONVERGED
|| aeState == CaptureResult.CONTROL_AE_STATE_PRECAPTURE
|| aeState == CaptureResult.CONTROL_AE_STATE_FLASH_REQUIRED) {
setCameraState(CameraState.STATE_WAITING_PRECAPTURE_DONE);
} else if (pictureCaptureRequest != null
&& pictureCaptureRequest.preCaptureMetering.getIsExpired()) {
Log.w(
"Camera",
"Metering timeout waiting for pre-capture to start, moving on with capture");

setCameraState(CameraState.STATE_WAITING_PRECAPTURE_DONE);
}
break;
}
case STATE_WAITING_PRECAPTURE_DONE:
{
// CONTROL_AE_STATE can be null on some devices
if (aeState == null || aeState != CaptureResult.CONTROL_AE_STATE_PRECAPTURE) {
cameraStateListener.onConverged();
} else if (pictureCaptureRequest != null
&& pictureCaptureRequest.preCaptureMetering.getIsExpired()) {
Log.w(
"Camera",
"Metering timeout waiting for pre-capture to finish, moving on with capture");
cameraStateListener.onConverged();
}

break;
}
}
}

private void handleWaitingFocusState(Integer aeState) {
// CONTROL_AE_STATE can be null on some devices
if (aeState == null || aeState == CaptureRequest.CONTROL_AE_STATE_CONVERGED) {
cameraStateListener.onConverged();
} else {
cameraStateListener.onPrecapture();
}
}

@Override
public void onCaptureProgressed(
@NonNull CameraCaptureSession session,
@NonNull CaptureRequest request,
@NonNull CaptureResult partialResult) {
process(partialResult);
}

@Override
public void onCaptureCompleted(
@NonNull CameraCaptureSession session,
@NonNull CaptureRequest request,
@NonNull TotalCaptureResult result) {
process(result);
}

interface CameraCaptureStateListener {
void onConverged();

void onPrecapture();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/
public final class CameraPlugin implements FlutterPlugin, ActivityAware {

private static final String TAG = "CameraPlugin";
// private static final String TAG = "CameraPlugin";
private @Nullable FlutterPluginBinding flutterPluginBinding;
private @Nullable MethodCallHandlerImpl methodCallHandler;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.camera;

import android.graphics.Rect;
import android.hardware.camera2.CameraAccessException;
import android.hardware.camera2.CameraCharacteristics;
import android.hardware.camera2.CameraManager;
import android.os.Build.VERSION_CODES;
import android.util.Range;
import android.util.Rational;
import android.util.Size;
import androidx.annotation.RequiresApi;

public interface CameraProperties {
String getCameraName();

Range<Integer>[] getControlAutoExposureAvailableTargetFpsRanges();

Range<Integer> getControlAutoExposureCompensationRange();

double getControlAutoExposureCompensationStep();

int[] getControlAutoFocusAvailableModes();

Integer getControlMaxRegionsAutoExposure();

Integer getControlMaxRegionsAutoFocus();

int[] getDistortionCorrectionAvailableModes();

Boolean getFlashInfoAvailable();

int getLensFacing();

Float getLensInfoMinimumFocusDistance();

Float getScalerAvailableMaxDigitalZoom();

Rect getSensorInfoActiveArraySize();

Size getSensorInfoPixelArraySize();

Rect getSensorInfoPreCorrectionActiveArraySize();

int getSensorOrientation();

int getHardwareLevel();

int[] getAvailableNoiseReductionModes();
}

class CameraPropertiesImpl implements CameraProperties {
private final CameraCharacteristics cameraCharacteristics;
private final String cameraName;

public CameraPropertiesImpl(String cameraName, CameraManager cameraManager)
throws CameraAccessException {
this.cameraName = cameraName;
this.cameraCharacteristics = cameraManager.getCameraCharacteristics(cameraName);
}

@Override
public String getCameraName() {
return cameraName;
}

@Override
public Range<Integer>[] getControlAutoExposureAvailableTargetFpsRanges() {
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES);
}

@Override
public Range<Integer> getControlAutoExposureCompensationRange() {
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_RANGE);
}

@Override
public double getControlAutoExposureCompensationStep() {
Rational rational =
cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_COMPENSATION_STEP);

return rational == null ? 0.0 : rational.doubleValue();
}

@Override
public int[] getControlAutoFocusAvailableModes() {
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES);
}

@Override
public Integer getControlMaxRegionsAutoExposure() {
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AE);
}

@Override
public Integer getControlMaxRegionsAutoFocus() {
return cameraCharacteristics.get(CameraCharacteristics.CONTROL_MAX_REGIONS_AF);
}

@RequiresApi(api = VERSION_CODES.P)
@Override
public int[] getDistortionCorrectionAvailableModes() {
return cameraCharacteristics.get(CameraCharacteristics.DISTORTION_CORRECTION_AVAILABLE_MODES);
}

@Override
public Boolean getFlashInfoAvailable() {
return cameraCharacteristics.get(CameraCharacteristics.FLASH_INFO_AVAILABLE);
}

@Override
public int getLensFacing() {
return cameraCharacteristics.get(CameraCharacteristics.LENS_FACING);
}

@Override
public Float getLensInfoMinimumFocusDistance() {
return cameraCharacteristics.get(CameraCharacteristics.LENS_INFO_MINIMUM_FOCUS_DISTANCE);
}

@Override
public Float getScalerAvailableMaxDigitalZoom() {
return cameraCharacteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM);
}

@Override
public Rect getSensorInfoActiveArraySize() {
return cameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_ACTIVE_ARRAY_SIZE);
}

@Override
public Size getSensorInfoPixelArraySize() {
return cameraCharacteristics.get(CameraCharacteristics.SENSOR_INFO_PIXEL_ARRAY_SIZE);
}

@RequiresApi(api = VERSION_CODES.M)
@Override
public Rect getSensorInfoPreCorrectionActiveArraySize() {
return cameraCharacteristics.get(
CameraCharacteristics.SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);
}

@Override
public int getSensorOrientation() {
return cameraCharacteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
}

/**
* Returns the hardware level of the camera.
*
* @return
*/
@Override
public int getHardwareLevel() {
return cameraCharacteristics.get(CameraCharacteristics.INFO_SUPPORTED_HARDWARE_LEVEL);
}

@Override
public int[] getAvailableNoiseReductionModes() {
return cameraCharacteristics.get(
CameraCharacteristics.NOISE_REDUCTION_AVAILABLE_NOISE_REDUCTION_MODES);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.plugins.camera;

/**
* These are the states that the camera can be in. The camera can only take one photo at a time so
* this state describes the state of the camera itself. The camera works like a pipeline where we
* feed it requests through. It can only process one tasks at a time.
*/
public enum CameraState {
/** Idle, showing preview and not capturing anything. */
STATE_PREVIEW,

/** Starting and waiting for autofocus to complete. */
STATE_WAITING_FOCUS,

/** Start performing autoexposure. */
STATE_WAITING_PRECAPTURE_START,

/** waiting for autoexposure to complete. */
STATE_WAITING_PRECAPTURE_DONE,

/** Capturing an image. */
STATE_CAPTURING,
}
Loading