mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Fix printing of FPS ranges in log messages
This commit is contained in:
parent
e3d6c3e49f
commit
39780fb86f
|
@ -217,7 +217,7 @@ final class CameraConfigurationManager {
|
|||
float step = parameters.getExposureCompensationStep();
|
||||
int desiredCompensation;
|
||||
if (newSetting) {
|
||||
// Light on; set low exposue compensation
|
||||
// Light on; set low exposure compensation
|
||||
desiredCompensation = Math.max((int) (MIN_EXPOSURE_COMPENSATION / step), minExposure);
|
||||
} else {
|
||||
// Light off; set high compensation
|
||||
|
@ -235,7 +235,7 @@ final class CameraConfigurationManager {
|
|||
private static void setBestPreviewFPS(Camera.Parameters parameters) {
|
||||
// Required for Glass compatibility; also improves battery/CPU performance a tad
|
||||
List<int[]> supportedPreviewFpsRanges = parameters.getSupportedPreviewFpsRange();
|
||||
Log.i(TAG, "Supported FPS ranges: " + supportedPreviewFpsRanges);
|
||||
Log.i(TAG, "Supported FPS ranges: " + toString(supportedPreviewFpsRanges));
|
||||
if (supportedPreviewFpsRanges != null && !supportedPreviewFpsRanges.isEmpty()) {
|
||||
int[] minimumSuitableFpsRange = null;
|
||||
for (int[] fpsRange : supportedPreviewFpsRanges) {
|
||||
|
@ -260,6 +260,24 @@ final class CameraConfigurationManager {
|
|||
}
|
||||
}
|
||||
|
||||
// Actually prints the arrays properly:
|
||||
private static String toString(Collection<int[]> arrays) {
|
||||
if (arrays == null || arrays.isEmpty()) {
|
||||
return "[]";
|
||||
}
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
buffer.append('[');
|
||||
Iterator<int[]> it = arrays.iterator();
|
||||
while (it.hasNext()) {
|
||||
buffer.append(Arrays.toString(it.next()));
|
||||
if (it.hasNext()) {
|
||||
buffer.append(", ");
|
||||
}
|
||||
}
|
||||
buffer.append(']');
|
||||
return buffer.toString();
|
||||
}
|
||||
|
||||
private Point findBestPreviewSizeValue(Camera.Parameters parameters, Point screenResolution) {
|
||||
|
||||
List<Camera.Size> rawSupportedSizes = parameters.getSupportedPreviewSizes();
|
||||
|
|
Loading…
Reference in a new issue