Merge "Camera: Add low latency suggested use case"
This commit is contained in:
committed by
Android (Google) Code Review
commit
40e9a201db
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -136,6 +136,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 {};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user