Loading core/java/android/hardware/camera2/params/StreamConfigurationMap.java +16 −5 Original line number Diff line number Diff line Loading @@ -98,9 +98,19 @@ public final class StreamConfigurationMap { HighSpeedVideoConfiguration[] highSpeedVideoConfigurations, ReprocessFormatsMap inputOutputFormatsMap, boolean listHighResolution) { 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) { Loading @@ -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()) { Loading Loading @@ -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"); } Loading media/java/android/media/ImageReader.java +20 −8 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading Loading
core/java/android/hardware/camera2/params/StreamConfigurationMap.java +16 −5 Original line number Diff line number Diff line Loading @@ -98,9 +98,19 @@ public final class StreamConfigurationMap { HighSpeedVideoConfiguration[] highSpeedVideoConfigurations, ReprocessFormatsMap inputOutputFormatsMap, boolean listHighResolution) { 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) { Loading @@ -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()) { Loading Loading @@ -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"); } Loading
media/java/android/media/ImageReader.java +20 −8 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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); Loading