|
|
|
@ -60,8 +60,8 @@ public class CameraOptions { |
|
|
|
|
private float exposureCorrectionMinValue; |
|
|
|
|
private float exposureCorrectionMaxValue; |
|
|
|
|
private boolean autoFocusSupported; |
|
|
|
|
private float fpsRangeMinValue; |
|
|
|
|
private float fpsRangeMaxValue; |
|
|
|
|
private float previewFrameRateMinValue; |
|
|
|
|
private float previewFrameRateMaxValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CameraOptions(@NonNull Camera.Parameters params, int cameraId, boolean flipSizes) { |
|
|
|
@ -160,8 +160,8 @@ public class CameraOptions { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//fps range
|
|
|
|
|
fpsRangeMinValue = 0F; |
|
|
|
|
fpsRangeMaxValue = 0F; |
|
|
|
|
previewFrameRateMinValue = 0F; |
|
|
|
|
previewFrameRateMaxValue = 0F; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Camera2Engine constructor.
|
|
|
|
@ -280,21 +280,21 @@ public class CameraOptions { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//fps Range
|
|
|
|
|
fpsRangeMinValue = Float.MAX_VALUE; |
|
|
|
|
fpsRangeMaxValue = Float.MIN_VALUE; |
|
|
|
|
previewFrameRateMinValue = Float.MAX_VALUE; |
|
|
|
|
previewFrameRateMaxValue = Float.MIN_VALUE; |
|
|
|
|
Range<Integer>[] range = cameraCharacteristics.get(CameraCharacteristics.CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES); |
|
|
|
|
if (range != null) { |
|
|
|
|
for (Range<Integer> fpsRange : range) { |
|
|
|
|
if (fpsRange.getLower() <= fpsRangeMinValue) { |
|
|
|
|
fpsRangeMinValue = fpsRange.getLower(); |
|
|
|
|
if (fpsRange.getLower() <= previewFrameRateMinValue) { |
|
|
|
|
previewFrameRateMinValue = fpsRange.getLower(); |
|
|
|
|
} |
|
|
|
|
if (fpsRange.getUpper() >= fpsRangeMaxValue) { |
|
|
|
|
fpsRangeMaxValue = fpsRange.getUpper(); |
|
|
|
|
if (fpsRange.getUpper() >= previewFrameRateMaxValue) { |
|
|
|
|
previewFrameRateMaxValue = fpsRange.getUpper(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
fpsRangeMinValue = 0F; |
|
|
|
|
fpsRangeMaxValue = 0F; |
|
|
|
|
previewFrameRateMinValue = 0F; |
|
|
|
|
previewFrameRateMaxValue = 0F; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -308,7 +308,6 @@ public class CameraOptions { |
|
|
|
|
return getSupportedControls(control.getClass()).contains(control); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Shorthand for other methods in this class, |
|
|
|
|
* e.g. supports(GestureAction.ZOOM) == isZoomSupported(). |
|
|
|
@ -333,7 +332,6 @@ public class CameraOptions { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
@NonNull |
|
|
|
|
public <T extends Control> Collection<T> getSupportedControls(@NonNull Class<T> controlClass) { |
|
|
|
@ -362,7 +360,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.emptyList(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported picture sizes for the currently opened camera. |
|
|
|
|
* |
|
|
|
@ -373,7 +370,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedPictureSizes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported picture aspect ratios for the currently opened camera. |
|
|
|
|
* |
|
|
|
@ -385,7 +381,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedPictureAspectRatio); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported video sizes for the currently opened camera. |
|
|
|
|
* |
|
|
|
@ -396,7 +391,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedVideoSizes); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported picture aspect ratios for the currently opened camera. |
|
|
|
|
* |
|
|
|
@ -408,7 +402,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedVideoAspectRatio); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported facing values. |
|
|
|
|
* |
|
|
|
@ -421,7 +414,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedFacing); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported flash values. |
|
|
|
|
* |
|
|
|
@ -436,7 +428,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedFlash); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported white balance values. |
|
|
|
|
* |
|
|
|
@ -452,7 +443,6 @@ public class CameraOptions { |
|
|
|
|
return Collections.unmodifiableSet(supportedWhiteBalance); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Set of supported hdr values. |
|
|
|
|
* |
|
|
|
@ -488,7 +478,6 @@ public class CameraOptions { |
|
|
|
|
return autoFocusSupported; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Whether exposure correction is supported. If this is false, calling |
|
|
|
|
* {@link CameraView#setExposureCorrection(float)} has no effect. |
|
|
|
@ -501,7 +490,6 @@ public class CameraOptions { |
|
|
|
|
return exposureCorrectionSupported; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The minimum value of negative exposure correction, in EV stops. |
|
|
|
|
* This is presumably negative or 0 if not supported. |
|
|
|
@ -524,18 +512,20 @@ public class CameraOptions { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The minimum value for FPS |
|
|
|
|
* The minimum value for the preview frame rate, in frames per second (FPS). |
|
|
|
|
* |
|
|
|
|
* @return the min value |
|
|
|
|
*/ |
|
|
|
|
public float getFpsRangeMinValue() { |
|
|
|
|
return fpsRangeMinValue; |
|
|
|
|
public float getPreviewFrameRateMinValue() { |
|
|
|
|
return previewFrameRateMinValue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* The maximum value for FPS |
|
|
|
|
* The maximum value for the preview frame rate, in frames per second (FPS). |
|
|
|
|
* |
|
|
|
|
* @return the max value |
|
|
|
|
*/ |
|
|
|
|
public float getFpsRangeMaxValue() { |
|
|
|
|
return fpsRangeMaxValue; |
|
|
|
|
public float getPreviewFrameRateMaxValue() { |
|
|
|
|
return previewFrameRateMaxValue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|