summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorEino-Ville Talvala <etalvala@google.com>2015-08-12 20:01:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-08-12 20:01:44 +0000
commit242ff8a89d851cc5c53b11dadd871fa55e00fbb5 (patch)
tree3f3cdb93f1cb3e097a32dd621a89ef5592931ecc /core
parentad285c169fd55bee8feef6e076a6710c357043e5 (diff)
parent72064af7e75f7e3b2eb2e58a3af408861eb8c4e9 (diff)
downloadframeworks_base-242ff8a89d851cc5c53b11dadd871fa55e00fbb5.zip
frameworks_base-242ff8a89d851cc5c53b11dadd871fa55e00fbb5.tar.gz
frameworks_base-242ff8a89d851cc5c53b11dadd871fa55e00fbb5.tar.bz2
Merge "Camera: Fix framework bugs with DEPTH-only camera devices" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r--core/java/android/hardware/camera2/params/StreamConfigurationMap.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
index 8e0eab2..e71e49f 100644
--- a/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
+++ b/core/java/android/hardware/camera2/params/StreamConfigurationMap.java
@@ -98,9 +98,19 @@ public final class StreamConfigurationMap {
HighSpeedVideoConfiguration[] highSpeedVideoConfigurations,
ReprocessFormatsMap inputOutputFormatsMap,
boolean listHighResolution) {
- mConfigurations = checkArrayElementsNotNull(configurations, "configurations");
- mMinFrameDurations = checkArrayElementsNotNull(minFrameDurations, "minFrameDurations");
- mStallDurations = checkArrayElementsNotNull(stallDurations, "stallDurations");
+
+ if (configurations == null) {
+ // If no color configurations exist, ensure depth ones do
+ checkArrayElementsNotNull(depthConfigurations, "depthConfigurations");
+ mConfigurations = new StreamConfiguration[0];
+ mMinFrameDurations = new StreamConfigurationDuration[0];
+ mStallDurations = new StreamConfigurationDuration[0];
+ } else {
+ mConfigurations = checkArrayElementsNotNull(configurations, "configurations");
+ mMinFrameDurations = checkArrayElementsNotNull(minFrameDurations, "minFrameDurations");
+ mStallDurations = checkArrayElementsNotNull(stallDurations, "stallDurations");
+ }
+
mListHighResolution = listHighResolution;
if (depthConfigurations == null) {
@@ -124,7 +134,7 @@ public final class StreamConfigurationMap {
}
// For each format, track how many sizes there are available to configure
- for (StreamConfiguration config : configurations) {
+ for (StreamConfiguration config : mConfigurations) {
int fmt = config.getFormat();
SparseIntArray map = null;
if (config.isOutput()) {
@@ -159,7 +169,8 @@ public final class StreamConfigurationMap {
mDepthOutputFormats.get(config.getFormat()) + 1);
}
- if (mOutputFormats.indexOfKey(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) < 0) {
+ if (configurations != null &&
+ mOutputFormats.indexOfKey(HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED) < 0) {
throw new AssertionError(
"At least one stream configuration for IMPLEMENTATION_DEFINED must exist");
}