diff options
4 files changed, 21 insertions, 4 deletions
diff --git a/api/current.txt b/api/current.txt index 8367f84b2198..53d10bbb53ae 100644 --- a/api/current.txt +++ b/api/current.txt @@ -17375,6 +17375,7 @@ package android.hardware.camera2.params { method @Nullable public java.util.Set<java.lang.Integer> getValidOutputFormatsForInput(int); method public boolean isOutputSupportedFor(int); method public boolean isOutputSupportedFor(@NonNull android.view.Surface); + field public static final int USECASE_LOW_LATENCY_SNAPSHOT = 6; // 0x6 field public static final int USECASE_PREVIEW = 0; // 0x0 field public static final int USECASE_RAW = 5; // 0x5 field public static final int USECASE_RECORD = 1; // 0x1 diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index 7ae673c1eded..c39796b881ca 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -336,6 +336,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri * <li>{@link RecommendedStreamConfigurationMap#USECASE_SNAPSHOT}</li> * <li>{@link RecommendedStreamConfigurationMap#USECASE_RAW}</li> * <li>{@link RecommendedStreamConfigurationMap#USECASE_ZSL}</li> + * <li>{@link RecommendedStreamConfigurationMap#USECASE_LOW_LATENCY_SNAPSHOT}</li> * </ul> * </p> * @@ -400,7 +401,7 @@ public final class CameraCharacteristics extends CameraMetadata<CameraCharacteri public @Nullable RecommendedStreamConfigurationMap getRecommendedStreamConfigurationMap( @RecommendedStreamConfigurationMap.RecommendedUsecase int usecase) { if (((usecase >= RecommendedStreamConfigurationMap.USECASE_PREVIEW) && - (usecase <= RecommendedStreamConfigurationMap.USECASE_RAW)) || + (usecase <= RecommendedStreamConfigurationMap.USECASE_LOW_LATENCY_SNAPSHOT)) || ((usecase >= RecommendedStreamConfigurationMap.USECASE_VENDOR_START) && (usecase < RecommendedStreamConfigurationMap.MAX_USECASE_COUNT))) { if (mRecommendedConfigurations == null) { diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index 1cdf23530ddc..e909c0075f38 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -1113,8 +1113,10 @@ public class CameraMetadataNative implements Parcelable { depthStreamDurationList.get(i), depthStreamStallList.get(i), depthScData); } - if ((scData.streamConfigurationArray == null) && - (depthScData.streamConfigurationArray == null)) { + if ((scData.streamConfigurationArray == null || + scData.streamConfigurationArray.length == 0) && + (depthScData.streamConfigurationArray == null || + depthScData.streamConfigurationArray.length == 0)) { recommendedConfigurations.add(null); continue; } @@ -1125,6 +1127,7 @@ public class CameraMetadataNative implements Parcelable { switch (i) { case RecommendedStreamConfigurationMap.USECASE_PREVIEW: case RecommendedStreamConfigurationMap.USECASE_RAW: + case RecommendedStreamConfigurationMap.USECASE_LOW_LATENCY_SNAPSHOT: case RecommendedStreamConfigurationMap.USECASE_VIDEO_SNAPSHOT: map = new StreamConfigurationMap(scData.streamConfigurationArray, scData.minDurationArray, scData.stallDurationArray, diff --git a/core/java/android/hardware/camera2/params/RecommendedStreamConfigurationMap.java b/core/java/android/hardware/camera2/params/RecommendedStreamConfigurationMap.java index 068c0ce8d052..b659c86f7e0f 100644 --- a/core/java/android/hardware/camera2/params/RecommendedStreamConfigurationMap.java +++ b/core/java/android/hardware/camera2/params/RecommendedStreamConfigurationMap.java @@ -137,6 +137,17 @@ public final class RecommendedStreamConfigurationMap { public static final int USECASE_RAW = 0x5; /** + * The recommended stream configuration map for use case low latency snapshot must contain + * subset of configurations with end-to-end latency that does not exceed 200 ms. under standard + * operating conditions (reasonable light levels, not loaded system). The expected output format + * will be primarily {@link android.graphics.ImageFormat#JPEG} however other image formats can + * be present as well. Even if available for the camera device, high speed and input + * configurations will be absent. This suggested configuration map may be absent on some devices + * that can not support any low latency requests. + */ + public static final int USECASE_LOW_LATENCY_SNAPSHOT = 0x6; + + /** * Device specific use cases. * @hide */ @@ -150,7 +161,8 @@ public final class RecommendedStreamConfigurationMap { USECASE_VIDEO_SNAPSHOT, USECASE_SNAPSHOT, USECASE_ZSL, - USECASE_RAW }) + USECASE_RAW, + USECASE_LOW_LATENCY_SNAPSHOT}) public @interface RecommendedUsecase {}; /** |