"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "android-core/src/main/java/com/google/zxing/client/android/camera/CameraConfigurationUtils.java" between
zxing-zxing-3.4.0.tar.gz and zxing-zxing-3.4.1.tar.gz

About: ZXing ("zebra crossing") is a multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages.

CameraConfigurationUtils.java  (zxing-zxing-3.4.0):CameraConfigurationUtils.java  (zxing-zxing-3.4.1)
skipping to change at line 171 skipping to change at line 171
parameters.setPreviewFpsRange(suitableFPSRange[Camera.Parameters.PREVI EW_FPS_MIN_INDEX], parameters.setPreviewFpsRange(suitableFPSRange[Camera.Parameters.PREVI EW_FPS_MIN_INDEX],
suitableFPSRange[Camera.Parameters.PREVI EW_FPS_MAX_INDEX]); suitableFPSRange[Camera.Parameters.PREVI EW_FPS_MAX_INDEX]);
} }
} }
} }
} }
public static void setFocusArea(Camera.Parameters parameters) { public static void setFocusArea(Camera.Parameters parameters) {
if (parameters.getMaxNumFocusAreas() > 0) { if (parameters.getMaxNumFocusAreas() > 0) {
Log.i(TAG, "Old focus areas: " + toString(parameters.getFocusAreas())); Log.i(TAG, "Old focus areas: " + toString(parameters.getFocusAreas()));
List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000); List<Camera.Area> middleArea = buildMiddleArea();
Log.i(TAG, "Setting focus area to : " + toString(middleArea)); Log.i(TAG, "Setting focus area to : " + toString(middleArea));
parameters.setFocusAreas(middleArea); parameters.setFocusAreas(middleArea);
} else { } else {
Log.i(TAG, "Device does not support focus areas"); Log.i(TAG, "Device does not support focus areas");
} }
} }
public static void setMetering(Camera.Parameters parameters) { public static void setMetering(Camera.Parameters parameters) {
if (parameters.getMaxNumMeteringAreas() > 0) { if (parameters.getMaxNumMeteringAreas() > 0) {
Log.i(TAG, "Old metering areas: " + parameters.getMeteringAreas()); Log.i(TAG, "Old metering areas: " + parameters.getMeteringAreas());
List<Camera.Area> middleArea = buildMiddleArea(AREA_PER_1000); List<Camera.Area> middleArea = buildMiddleArea();
Log.i(TAG, "Setting metering area to : " + toString(middleArea)); Log.i(TAG, "Setting metering area to : " + toString(middleArea));
parameters.setMeteringAreas(middleArea); parameters.setMeteringAreas(middleArea);
} else { } else {
Log.i(TAG, "Device does not support metering areas"); Log.i(TAG, "Device does not support metering areas");
} }
} }
private static List<Camera.Area> buildMiddleArea(int areaPer1000) { private static List<Camera.Area> buildMiddleArea() {
return Collections.singletonList( return Collections.singletonList(
new Camera.Area(new Rect(-areaPer1000, -areaPer1000, areaPer1000, areaPe r1000), 1)); new Camera.Area(new Rect(-AREA_PER_1000, -AREA_PER_1000, AREA_PER_1000, AREA_PER_1000), 1));
} }
public static void setVideoStabilization(Camera.Parameters parameters) { public static void setVideoStabilization(Camera.Parameters parameters) {
if (parameters.isVideoStabilizationSupported()) { if (parameters.isVideoStabilizationSupported()) {
if (parameters.getVideoStabilization()) { if (parameters.getVideoStabilization()) {
Log.i(TAG, "Video stabilization already enabled"); Log.i(TAG, "Video stabilization already enabled");
} else { } else {
Log.i(TAG, "Enabling video stabilization..."); Log.i(TAG, "Enabling video stabilization...");
parameters.setVideoStabilization(true); parameters.setVideoStabilization(true);
} }
skipping to change at line 398 skipping to change at line 398
} }
return result.toString(); return result.toString();
} }
public static String collectStats(Camera.Parameters parameters) { public static String collectStats(Camera.Parameters parameters) {
return collectStats(parameters.flatten()); return collectStats(parameters.flatten());
} }
public static String collectStats(CharSequence flattenedParams) { public static String collectStats(CharSequence flattenedParams) {
StringBuilder result = new StringBuilder(1000); StringBuilder result = new StringBuilder(1000);
appendStat(result, "BOARD", Build.BOARD);
result.append("BOARD=").append(Build.BOARD).append('\n'); appendStat(result, "BRAND", Build.BRAND);
result.append("BRAND=").append(Build.BRAND).append('\n'); appendStat(result, "CPU_ABI", Build.CPU_ABI);
result.append("CPU_ABI=").append(Build.CPU_ABI).append('\n'); appendStat(result, "DEVICE", Build.DEVICE);
result.append("DEVICE=").append(Build.DEVICE).append('\n'); appendStat(result, "DISPLAY", Build.DISPLAY);
result.append("DISPLAY=").append(Build.DISPLAY).append('\n'); appendStat(result, "FINGERPRINT", Build.FINGERPRINT);
result.append("FINGERPRINT=").append(Build.FINGERPRINT).append('\n'); appendStat(result, "HOST", Build.HOST);
result.append("HOST=").append(Build.HOST).append('\n'); appendStat(result, "ID", Build.ID);
result.append("ID=").append(Build.ID).append('\n'); appendStat(result, "MANUFACTURER", Build.MANUFACTURER);
result.append("MANUFACTURER=").append(Build.MANUFACTURER).append('\n'); appendStat(result, "MODEL", Build.MODEL);
result.append("MODEL=").append(Build.MODEL).append('\n'); appendStat(result, "PRODUCT", Build.PRODUCT);
result.append("PRODUCT=").append(Build.PRODUCT).append('\n'); appendStat(result, "TAGS", Build.TAGS);
result.append("TAGS=").append(Build.TAGS).append('\n'); appendStat(result, "TIME", Build.TIME);
result.append("TIME=").append(Build.TIME).append('\n'); appendStat(result, "TYPE", Build.TYPE);
result.append("TYPE=").append(Build.TYPE).append('\n'); appendStat(result, "USER", Build.USER);
result.append("USER=").append(Build.USER).append('\n'); appendStat(result, "VERSION.CODENAME", Build.VERSION.CODENAME);
result.append("VERSION.CODENAME=").append(Build.VERSION.CODENAME).append('\n appendStat(result, "VERSION.INCREMENTAL", Build.VERSION.INCREMENTAL);
'); appendStat(result, "VERSION.RELEASE", Build.VERSION.RELEASE);
result.append("VERSION.INCREMENTAL=").append(Build.VERSION.INCREMENTAL).appe appendStat(result, "VERSION.SDK_INT", Build.VERSION.SDK_INT);
nd('\n');
result.append("VERSION.RELEASE=").append(Build.VERSION.RELEASE).append('\n')
;
result.append("VERSION.SDK_INT=").append(Build.VERSION.SDK_INT).append('\n')
;
if (flattenedParams != null) { if (flattenedParams != null) {
String[] params = SEMICOLON.split(flattenedParams); String[] params = SEMICOLON.split(flattenedParams);
Arrays.sort(params); Arrays.sort(params);
for (String param : params) { for (String param : params) {
result.append(param).append('\n'); result.append(param).append('\n');
} }
} }
return result.toString(); return result.toString();
} }
private static void appendStat(StringBuilder builder, String stat, Object valu
e) {
builder.append(stat).append('=').append(value).append('\n');
}
} }
 End of changes. 6 change blocks. 
28 lines changed or deleted 28 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)