diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2015-08-11 13:33:37 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2015-08-11 15:04:56 -0700 |
commit | 72064af7e75f7e3b2eb2e58a3af408861eb8c4e9 (patch) | |
tree | a123e4b89697df201bfedab2410f756cc16f9953 /media/java | |
parent | 301dfe08bc662e9475739309a0ccbce2231ecddb (diff) | |
download | frameworks_base-72064af7e75f7e3b2eb2e58a3af408861eb8c4e9.zip frameworks_base-72064af7e75f7e3b2eb2e58a3af408861eb8c4e9.tar.gz frameworks_base-72064af7e75f7e3b2eb2e58a3af408861eb8c4e9.tar.bz2 |
Camera: Fix framework bugs with DEPTH-only camera devices
Mostly due to no standard stream configurations being defined,
and for the correct overrides for DEPTH_POINT_CLOUD format.
Bug: 20537722
Change-Id: I8a18f5f68697a09dcc4d7555e51728193fe7f333
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/ImageReader.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/media/java/android/media/ImageReader.java b/media/java/android/media/ImageReader.java index c97de5d..2164eec 100644 --- a/media/java/android/media/ImageReader.java +++ b/media/java/android/media/ImageReader.java @@ -679,17 +679,31 @@ public class ImageReader implements AutoCloseable { @Override public int getWidth() { throwISEIfImageIsInvalid(); - mWidth = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getWidth() : - nativeGetWidth(mFormat); - return mWidth; + int width; + switch(getFormat()) { + case ImageFormat.JPEG: + case ImageFormat.DEPTH_POINT_CLOUD: + width = ImageReader.this.getWidth(); + break; + default: + width = nativeGetWidth(mFormat); + } + return width; } @Override public int getHeight() { throwISEIfImageIsInvalid(); - mHeight = (getFormat() == ImageFormat.JPEG) ? ImageReader.this.getHeight() : - nativeGetHeight(mFormat); - return mHeight; + int height; + switch(getFormat()) { + case ImageFormat.JPEG: + case ImageFormat.DEPTH_POINT_CLOUD: + height = ImageReader.this.getHeight(); + break; + default: + height = nativeGetHeight(mFormat); + } + return height; } @Override @@ -826,8 +840,6 @@ public class ImageReader implements AutoCloseable { private long mTimestamp; private SurfacePlane[] mPlanes; - private int mHeight = -1; - private int mWidth = -1; private int mFormat = ImageFormat.UNKNOWN; // If this image is detached from the ImageReader. private AtomicBoolean mIsDetached = new AtomicBoolean(false); |