diff options
| author | Emilian Peev <epeev@google.com> | 2019-03-12 18:00:42 -0700 |
|---|---|---|
| committer | Emilian Peev <epeev@google.com> | 2019-03-18 08:50:45 -0700 |
| commit | 506acca748d12525e2a6aae4c054113425c04907 (patch) | |
| tree | 2dae29045ccbd502e715a88753c0f6d60381612f /core/java | |
| parent | 95f66bbb55a0232ee1f4195e9b6ae75b44f82e05 (diff) | |
Camera: Add low latency suggested use case
Extend the recommended configuration map use cases
with additional entry for low latency snapshots.
The map could be absent in case devices are not able
to support such low latency requests.
Bug: 128450197
Test: Camera CTS
Change-Id: Ica9285978aeb40fce636f519f38488ac539c0bce
Diffstat (limited to 'core/java')
3 files changed, 20 insertions, 4 deletions
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 {}; /** |
