OSDN Git Service

Camera2 legacy: Do not advertise NV21 support.
authorEino-Ville Talvala <etalvala@google.com>
Wed, 28 Jan 2015 20:55:12 +0000 (12:55 -0800)
committerEino-Ville Talvala <etalvala@google.com>
Wed, 28 Jan 2015 20:57:56 +0000 (12:57 -0800)
Also reduce logging somewhat for common scenarios.

Bug: 19161738
Change-Id: If96ed7d2bac0229159564072d7969d7bea3fae27

core/java/android/hardware/camera2/legacy/LegacyMetadataMapper.java
core/java/android/hardware/camera2/utils/ArrayUtils.java

index 03540e1..347db05 100644 (file)
@@ -328,15 +328,15 @@ public class LegacyMetadataMapper {
         appendStreamConfig(availableStreamConfigs,
                 ImageFormat.YUV_420_888, previewSizes);
         for (int format : p.getSupportedPreviewFormats()) {
-            if (ImageFormat.isPublicFormat(format)) {
+            if (ImageFormat.isPublicFormat(format) && format != ImageFormat.NV21) {
                 appendStreamConfig(availableStreamConfigs, format, previewSizes);
-            } else {
+            } else if (VERBOSE) {
                 /*
                  *  Do not add any formats unknown to us
                  * (since it would fail runtime checks in StreamConfigurationMap)
                  */
-                Log.w(TAG,
-                        String.format("mapStreamConfigs - Skipping non-public format %x", format));
+                Log.v(TAG,
+                        String.format("mapStreamConfigs - Skipping format %x", format));
             }
         }
 
@@ -389,8 +389,8 @@ public class LegacyMetadataMapper {
             int j = 0;
             for (String mode : antiBandingModes) {
                 int convertedMode = convertAntiBandingMode(mode);
-                if (convertedMode == -1) {
-                    Log.w(TAG, "Antibanding mode " + ((mode == null) ? "NULL" : mode) +
+                if (VERBOSE && convertedMode == -1) {
+                    Log.v(TAG, "Antibanding mode " + ((mode == null) ? "NULL" : mode) +
                             " not supported, skipping...");
                 } else {
                     modes[j++] = convertedMode;
index 5a78bbd..79a335c 100644 (file)
@@ -117,7 +117,7 @@ public class ArrayUtils {
 
             // Guard against unexpected values
             if (strIndex < 0) {
-                Log.w(TAG, "Ignoring invalid value " + str);
+                if (VERBOSE) Log.v(TAG, "Ignoring invalid value " + str);
                 continue;
             }