summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-10-14 12:25:08 -0700
committerMichael Bestas <mikeioannina@gmail.com>2015-09-17 23:26:01 +0300
commitb9347d9cf727fa14f9b44adb43e0db60fbe32d8d (patch)
treea5b3c59e0b135a51d4c7656d3a1bb17258c88f79
parentd2a585416a19a3a4a9552333d8aa41c36862d903 (diff)
downloadandroid_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.zip
android_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.tar.gz
android_packages_apps_Snap-b9347d9cf727fa14f9b44adb43e0db60fbe32d8d.tar.bz2
camera: Add parameter debugging support
Change-Id: Ifc1653f0046af169ba36d94796b4d9a3055c6798
-rw-r--r--src/com/android/camera/PhotoModule.java1
-rw-r--r--src/com/android/camera/VideoModule.java3
-rw-r--r--src/com/android/camera/util/CameraUtil.java28
3 files changed, 26 insertions, 6 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 5e3e58a..ade3b47 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -3645,6 +3645,7 @@ public class PhotoModule
doModeSwitch = updateCameraParametersPreference();
}
+ CameraUtil.dumpParameters(mParameters);
mCameraDevice.setParameters(mParameters);
// Switch to gcam module if HDR+ was selected
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index 273ada9..b821926 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -2408,6 +2408,9 @@ public class VideoModule implements CameraModule,
int jpegQuality = CameraProfile.getJpegEncodingQualityParameter(mCameraId,
CameraProfile.QUALITY_HIGH);
mParameters.setJpegQuality(jpegQuality);
+
+ CameraUtil.dumpParameters(mParameters);
+
//Call Qcom related Camera Parameters
qcomSetCameraParameters();
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index 1217cde..8017849 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -65,10 +65,14 @@ import java.io.Closeable;
import java.io.IOException;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
+import java.util.Arrays;
import java.util.Date;
+import java.util.Iterator;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
import java.util.StringTokenizer;
+import java.util.TreeSet;
/**
* Collection of utility functions used in this package.
@@ -605,13 +609,25 @@ public class CameraUtil {
return optimalSize;
}
- public static void dumpParameters(Parameters parameters) {
- String flattened = parameters.flatten();
- StringTokenizer tokenizer = new StringTokenizer(flattened, ";");
- Log.d(TAG, "Dump all camera parameters:");
- while (tokenizer.hasMoreElements()) {
- Log.d(TAG, tokenizer.nextToken());
+ public static void dumpParameters(Parameters params) {
+ Set<String> sortedParams = new TreeSet<String>();
+ sortedParams.addAll(Arrays.asList(params.flatten().split(";")));
+ StringBuilder sb = new StringBuilder();
+ sb.append("[");
+ Iterator<String> i = sortedParams.iterator();
+ while (i.hasNext()) {
+ String nextParam = i.next();
+ if ((sb.length() + nextParam.length()) > 2044) {
+ Log.d(TAG, "Parameters: " + sb.toString());
+ sb = new StringBuilder();
+ }
+ sb.append(nextParam);
+ if (i.hasNext()) {
+ sb.append(", ");
+ }
}
+ sb.append("]");
+ Log.d(TAG, "Parameters: " + sb.toString());
}
/**