Loading core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java +11 −4 Original line number Diff line number Diff line Loading @@ -348,9 +348,7 @@ public class LegacyCameraDevice implements AutoCloseable { Size[] sizes = streamConfigurations.getOutputSizes(surfaceType); if (sizes == null) { // WAR: Override default format to IMPLEMENTATION_DEFINED for b/9487482 if ((surfaceType >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceType <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { if (surfaceType == ImageFormat.PRIVATE) { // YUV_420_888 is always present in LEGACY for all // IMPLEMENTATION_DEFINED output sizes, and is publicly visible in the Loading Loading @@ -649,7 +647,16 @@ public class LegacyCameraDevice implements AutoCloseable { */ public static int detectSurfaceType(Surface surface) throws BufferQueueAbandonedException { checkNotNull(surface); return LegacyExceptionUtils.throwOnError(nativeDetectSurfaceType(surface)); int surfaceType = nativeDetectSurfaceType(surface); // TODO: remove this override since the default format should be // ImageFormat.PRIVATE. b/9487482 if ((surfaceType >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceType <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { surfaceType = ImageFormat.PRIVATE; } return LegacyExceptionUtils.throwOnError(surfaceType); } /** Loading core/java/android/hardware/camera2/params/StreamConfigurationMap.java +0 −6 Original line number Diff line number Diff line Loading @@ -408,12 +408,6 @@ public final class StreamConfigurationMap { // See if consumer is flexible. boolean isFlexible = SurfaceUtils.isFlexibleConsumer(surface); // Override RGB formats to IMPLEMENTATION_DEFINED, b/9487482 if ((surfaceFormat >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceFormat <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { surfaceFormat = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED; } StreamConfiguration[] configs = surfaceDataspace != HAL_DATASPACE_DEPTH ? mConfigurations : mDepthConfigurations; for (StreamConfiguration config : configs) { Loading core/java/android/hardware/camera2/utils/SurfaceUtils.java +0 −8 Original line number Diff line number Diff line Loading @@ -118,15 +118,7 @@ public class SurfaceUtils { * @param surface The high speed output surface to be checked. */ private static void checkHighSpeedSurfaceFormat(Surface surface) { // TODO: remove this override since the default format should be // ImageFormat.PRIVATE. b/9487482 final int HAL_FORMAT_RGB_START = 1; // HAL_PIXEL_FORMAT_RGBA_8888 from graphics.h final int HAL_FORMAT_RGB_END = 5; // HAL_PIXEL_FORMAT_BGRA_8888 from graphics.h int surfaceFormat = SurfaceUtils.getSurfaceFormat(surface); if (surfaceFormat >= HAL_FORMAT_RGB_START && surfaceFormat <= HAL_FORMAT_RGB_END) { surfaceFormat = ImageFormat.PRIVATE; } if (surfaceFormat != ImageFormat.PRIVATE) { throw new IllegalArgumentException("Surface format(" + surfaceFormat + ") is not" Loading Loading
core/java/android/hardware/camera2/legacy/LegacyCameraDevice.java +11 −4 Original line number Diff line number Diff line Loading @@ -348,9 +348,7 @@ public class LegacyCameraDevice implements AutoCloseable { Size[] sizes = streamConfigurations.getOutputSizes(surfaceType); if (sizes == null) { // WAR: Override default format to IMPLEMENTATION_DEFINED for b/9487482 if ((surfaceType >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceType <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { if (surfaceType == ImageFormat.PRIVATE) { // YUV_420_888 is always present in LEGACY for all // IMPLEMENTATION_DEFINED output sizes, and is publicly visible in the Loading Loading @@ -649,7 +647,16 @@ public class LegacyCameraDevice implements AutoCloseable { */ public static int detectSurfaceType(Surface surface) throws BufferQueueAbandonedException { checkNotNull(surface); return LegacyExceptionUtils.throwOnError(nativeDetectSurfaceType(surface)); int surfaceType = nativeDetectSurfaceType(surface); // TODO: remove this override since the default format should be // ImageFormat.PRIVATE. b/9487482 if ((surfaceType >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceType <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { surfaceType = ImageFormat.PRIVATE; } return LegacyExceptionUtils.throwOnError(surfaceType); } /** Loading
core/java/android/hardware/camera2/params/StreamConfigurationMap.java +0 −6 Original line number Diff line number Diff line Loading @@ -408,12 +408,6 @@ public final class StreamConfigurationMap { // See if consumer is flexible. boolean isFlexible = SurfaceUtils.isFlexibleConsumer(surface); // Override RGB formats to IMPLEMENTATION_DEFINED, b/9487482 if ((surfaceFormat >= LegacyMetadataMapper.HAL_PIXEL_FORMAT_RGBA_8888 && surfaceFormat <= LegacyMetadataMapper.HAL_PIXEL_FORMAT_BGRA_8888)) { surfaceFormat = HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED; } StreamConfiguration[] configs = surfaceDataspace != HAL_DATASPACE_DEPTH ? mConfigurations : mDepthConfigurations; for (StreamConfiguration config : configs) { Loading
core/java/android/hardware/camera2/utils/SurfaceUtils.java +0 −8 Original line number Diff line number Diff line Loading @@ -118,15 +118,7 @@ public class SurfaceUtils { * @param surface The high speed output surface to be checked. */ private static void checkHighSpeedSurfaceFormat(Surface surface) { // TODO: remove this override since the default format should be // ImageFormat.PRIVATE. b/9487482 final int HAL_FORMAT_RGB_START = 1; // HAL_PIXEL_FORMAT_RGBA_8888 from graphics.h final int HAL_FORMAT_RGB_END = 5; // HAL_PIXEL_FORMAT_BGRA_8888 from graphics.h int surfaceFormat = SurfaceUtils.getSurfaceFormat(surface); if (surfaceFormat >= HAL_FORMAT_RGB_START && surfaceFormat <= HAL_FORMAT_RGB_END) { surfaceFormat = ImageFormat.PRIVATE; } if (surfaceFormat != ImageFormat.PRIVATE) { throw new IllegalArgumentException("Surface format(" + surfaceFormat + ") is not" Loading