From 404ce3f141b1410214d85348543ab532deb668f0 Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Tue, 15 Feb 2022 11:37:50 -0800 Subject: [PATCH] Camera: Allow clients to query for extra profile latency Additionally switch the dynamic range profiles to long values instead of integers. Bug: 215396395 Test: Camera CTS Change-Id: I4700af73f31423fd9316cfb08a351b0cde731d76 --- core/api/current.txt | 39 +++--- .../android/hardware/CameraStreamStats.java | 10 +- .../camera2/CameraCharacteristics.java | 8 +- .../hardware/camera2/CameraDevice.java | 4 +- .../camera2/impl/CameraMetadataNative.java | 2 +- .../camera2/params/DynamicRangeProfiles.java | 118 ++++++++++-------- .../params/MandatoryStreamCombination.java | 2 +- .../camera2/params/OutputConfiguration.java | 10 +- proto/src/camera.proto | 2 +- 9 files changed, 107 insertions(+), 88 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 3a6fc590648ef..e5071e46d98ad 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -17391,7 +17391,7 @@ package android.hardware.camera2 { field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_MAX_NUM_OUTPUT_RAW; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_PARTIAL_RESULT_COUNT; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_PIPELINE_MAX_DEPTH; - field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE; + field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_AVAILABLE_MAX_DIGITAL_ZOOM; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_AVAILABLE_ROTATE_AND_CROP_MODES; field @NonNull public static final android.hardware.camera2.CameraCharacteristics.Key SCALER_AVAILABLE_STREAM_USE_CASES; @@ -18111,22 +18111,23 @@ package android.hardware.camera2.params { } public final class DynamicRangeProfiles { - ctor public DynamicRangeProfiles(@NonNull int[]); - method @NonNull public java.util.Set getProfileCaptureRequestConstraints(int); - method @NonNull public java.util.Set getSupportedProfiles(); - field public static final int DOLBY_VISION_10B_HDR_OEM = 64; // 0x40 - field public static final int DOLBY_VISION_10B_HDR_OEM_PO = 128; // 0x80 - field public static final int DOLBY_VISION_10B_HDR_REF = 16; // 0x10 - field public static final int DOLBY_VISION_10B_HDR_REF_PO = 32; // 0x20 - field public static final int DOLBY_VISION_8B_HDR_OEM = 1024; // 0x400 - field public static final int DOLBY_VISION_8B_HDR_OEM_PO = 2048; // 0x800 - field public static final int DOLBY_VISION_8B_HDR_REF = 256; // 0x100 - field public static final int DOLBY_VISION_8B_HDR_REF_PO = 512; // 0x200 - field public static final int HDR10 = 4; // 0x4 - field public static final int HDR10_PLUS = 8; // 0x8 - field public static final int HLG10 = 2; // 0x2 - field public static final int PUBLIC_MAX = 4096; // 0x1000 - field public static final int STANDARD = 1; // 0x1 + ctor public DynamicRangeProfiles(@NonNull long[]); + method @NonNull public java.util.Set getProfileCaptureRequestConstraints(long); + method @NonNull public java.util.Set getSupportedProfiles(); + method public boolean isExtraLatencyPresent(long); + field public static final long DOLBY_VISION_10B_HDR_OEM = 64L; // 0x40L + field public static final long DOLBY_VISION_10B_HDR_OEM_PO = 128L; // 0x80L + field public static final long DOLBY_VISION_10B_HDR_REF = 16L; // 0x10L + field public static final long DOLBY_VISION_10B_HDR_REF_PO = 32L; // 0x20L + field public static final long DOLBY_VISION_8B_HDR_OEM = 1024L; // 0x400L + field public static final long DOLBY_VISION_8B_HDR_OEM_PO = 2048L; // 0x800L + field public static final long DOLBY_VISION_8B_HDR_REF = 256L; // 0x100L + field public static final long DOLBY_VISION_8B_HDR_REF_PO = 512L; // 0x200L + field public static final long HDR10 = 4L; // 0x4L + field public static final long HDR10_PLUS = 8L; // 0x8L + field public static final long HLG10 = 2L; // 0x2L + field public static final long PUBLIC_MAX = 4096L; // 0x1000L + field public static final long STANDARD = 1L; // 0x1L } public final class ExtensionSessionConfiguration { @@ -18233,7 +18234,7 @@ package android.hardware.camera2.params { method @NonNull public static java.util.Collection createInstancesForMultiResolutionOutput(@NonNull android.hardware.camera2.MultiResolutionImageReader); method public int describeContents(); method public void enableSurfaceSharing(); - method public int getDynamicRangeProfile(); + method public long getDynamicRangeProfile(); method public int getMaxSharedSurfaceCount(); method public int getMirrorMode(); method public int getStreamUseCase(); @@ -18243,7 +18244,7 @@ package android.hardware.camera2.params { method public int getTimestampBase(); method public void removeSensorPixelModeUsed(int); method public void removeSurface(@NonNull android.view.Surface); - method public void setDynamicRangeProfile(int); + method public void setDynamicRangeProfile(long); method public void setMirrorMode(int); method public void setPhysicalCameraId(@Nullable String); method public void setStreamUseCase(int); diff --git a/core/java/android/hardware/CameraStreamStats.java b/core/java/android/hardware/CameraStreamStats.java index 85890c1912c5d..823d454ee16b4 100644 --- a/core/java/android/hardware/CameraStreamStats.java +++ b/core/java/android/hardware/CameraStreamStats.java @@ -47,7 +47,7 @@ public class CameraStreamStats implements Parcelable { private int mHistogramType; private float[] mHistogramBins; private long[] mHistogramCounts; - private int mDynamicRangeProfile; + private long mDynamicRangeProfile; private int mStreamUseCase; private static final String TAG = "CameraStreamStats"; @@ -70,7 +70,7 @@ public class CameraStreamStats implements Parcelable { public CameraStreamStats(int width, int height, int format, int dataSpace, long usage, long requestCount, long errorCount, - int startLatencyMs, int maxHalBuffers, int maxAppBuffers, int dynamicRangeProfile, + int startLatencyMs, int maxHalBuffers, int maxAppBuffers, long dynamicRangeProfile, int streamUseCase) { mWidth = width; mHeight = height; @@ -130,7 +130,7 @@ public class CameraStreamStats implements Parcelable { dest.writeInt(mHistogramType); dest.writeFloatArray(mHistogramBins); dest.writeLongArray(mHistogramCounts); - dest.writeInt(mDynamicRangeProfile); + dest.writeLong(mDynamicRangeProfile); dest.writeInt(mStreamUseCase); } @@ -148,7 +148,7 @@ public class CameraStreamStats implements Parcelable { mHistogramType = in.readInt(); mHistogramBins = in.createFloatArray(); mHistogramCounts = in.createLongArray(); - mDynamicRangeProfile = in.readInt(); + mDynamicRangeProfile = in.readLong(); mStreamUseCase = in.readInt(); } @@ -204,7 +204,7 @@ public class CameraStreamStats implements Parcelable { return mHistogramCounts; } - public int getDynamicRangeProfile() { + public long getDynamicRangeProfile() { return mDynamicRangeProfile; } diff --git a/core/java/android/hardware/camera2/CameraCharacteristics.java b/core/java/android/hardware/camera2/CameraCharacteristics.java index 524fe795cb75c..7bebe1ff14c32 100644 --- a/core/java/android/hardware/camera2/CameraCharacteristics.java +++ b/core/java/android/hardware/camera2/CameraCharacteristics.java @@ -2448,8 +2448,8 @@ public final class CameraCharacteristics extends CameraMetadata REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = - new Key("android.request.availableDynamicRangeProfilesMap", int[].class); + public static final Key REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP = + new Key("android.request.availableDynamicRangeProfilesMap", long[].class); /** *

Recommended 10-bit dynamic range profile.

@@ -2464,8 +2464,8 @@ public final class CameraCharacteristics extends CameraMetadata REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = - new Key("android.request.recommendedTenBitDynamicRangeProfile", int.class); + public static final Key REQUEST_RECOMMENDED_TEN_BIT_DYNAMIC_RANGE_PROFILE = + new Key("android.request.recommendedTenBitDynamicRangeProfile", long.class); /** *

The list of image formats that are supported by this diff --git a/core/java/android/hardware/camera2/CameraDevice.java b/core/java/android/hardware/camera2/CameraDevice.java index 8f42b1f6f3556..73735edbb2bac 100644 --- a/core/java/android/hardware/camera2/CameraDevice.java +++ b/core/java/android/hardware/camera2/CameraDevice.java @@ -990,7 +990,7 @@ public abstract class CameraDevice implements AutoCloseable { *

Reprocessing with 10-bit output targets on 10-bit capable * {@link CameraCharacteristics#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT} devices is * not supported. Trying to initialize a repreocessable capture session with one ore more - * output configurations set {@link OutputConfiguration#setDynamicRangeProfile(int)} to use + * output configurations set {@link OutputConfiguration#setDynamicRangeProfile} to use * a 10-bit dynamic range profile {@link android.hardware.camera2.params.DynamicRangeProfiles} * will trigger {@link IllegalArgumentException}.

* @@ -1179,7 +1179,7 @@ public abstract class CameraDevice implements AutoCloseable { * @see #createCaptureSessionByOutputConfigurations * @see #createReprocessableCaptureSession * @see #createConstrainedHighSpeedCaptureSession - * @see OutputConfiguration#setDynamicRangeProfile(int) + * @see OutputConfiguration#setDynamicRangeProfile * @see android.hardware.camera2.params.DynamicRangeProfiles */ public void createCaptureSession( diff --git a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java index 4fb496d66fbdd..468e6041eb73c 100644 --- a/core/java/android/hardware/camera2/impl/CameraMetadataNative.java +++ b/core/java/android/hardware/camera2/impl/CameraMetadataNative.java @@ -1058,7 +1058,7 @@ public class CameraMetadataNative implements Parcelable { } private DynamicRangeProfiles getDynamicRangeProfiles() { - int[] profileArray = getBase( + long[] profileArray = getBase( CameraCharacteristics.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP); if (profileArray == null) { diff --git a/core/java/android/hardware/camera2/params/DynamicRangeProfiles.java b/core/java/android/hardware/camera2/params/DynamicRangeProfiles.java index 5c1a4aa120ea6..cbd84e77e72a0 100644 --- a/core/java/android/hardware/camera2/params/DynamicRangeProfiles.java +++ b/core/java/android/hardware/camera2/params/DynamicRangeProfiles.java @@ -16,7 +16,7 @@ package android.hardware.camera2.params; -import android.annotation.IntDef; +import android.annotation.LongDef; import android.annotation.NonNull; import android.hardware.camera2.CameraMetadata; @@ -27,7 +27,6 @@ import java.lang.annotation.RetentionPolicy; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; -import java.util.Objects; import java.util.Set; /** @@ -44,20 +43,20 @@ import java.util.Set; * *

Some devices may not be able to support 8-bit and/or 10-bit output with different dynamic * range profiles within the same capture request. Such device specific constraints can be queried - * by calling {@link #getProfileCaptureRequestConstraints(int)}. Do note that unsupported + * by calling {@link #getProfileCaptureRequestConstraints}. Do note that unsupported * combinations will result in {@link IllegalArgumentException} when trying to submit a capture * request. Capture requests that only reference outputs configured using the same dynamic range * profile value will never fail due to such constraints.

* - * @see OutputConfiguration#setDynamicRangeProfile(int) + * @see OutputConfiguration#setDynamicRangeProfile */ public final class DynamicRangeProfiles { /** * This the default 8-bit standard profile that will be used in case where camera clients do not * explicitly configure a supported dynamic range profile by calling - * {@link OutputConfiguration#setDynamicRangeProfile(int)}. + * {@link OutputConfiguration#setDynamicRangeProfile}. */ - public static final int STANDARD = + public static final long STANDARD = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD; /** @@ -65,7 +64,7 @@ public final class DynamicRangeProfiles { * *

All 10-bit output capable devices are required to support this profile.

*/ - public static final int HLG10 = + public static final long HLG10 = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HLG10; /** @@ -74,7 +73,7 @@ public final class DynamicRangeProfiles { *

This profile utilizes internal static metadata to increase the quality * of the capture.

*/ - public static final int HDR10 = + public static final long HDR10 = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10; /** @@ -83,7 +82,7 @@ public final class DynamicRangeProfiles { *

In contrast to HDR10, this profile uses internal per-frame metadata * to further enhance the quality of the capture.

*/ - public static final int HDR10_PLUS = + public static final long HDR10_PLUS = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_HDR10_PLUS; /** @@ -91,13 +90,13 @@ public final class DynamicRangeProfiles { * accurate capture. This would typically differ from what a specific device * might want to tune for a consumer optimized Dolby Vision general capture.

*/ - public static final int DOLBY_VISION_10B_HDR_REF = + public static final long DOLBY_VISION_10B_HDR_REF = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF; /** *

This is the power optimized mode for 10-bit Dolby Vision HDR Reference Mode.

*/ - public static final int DOLBY_VISION_10B_HDR_REF_PO = + public static final long DOLBY_VISION_10B_HDR_REF_PO = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_REF_PO; /** @@ -107,52 +106,52 @@ public final class DynamicRangeProfiles { * that each specific device would have a different look for their default * Dolby Vision capture.

*/ - public static final int DOLBY_VISION_10B_HDR_OEM = + public static final long DOLBY_VISION_10B_HDR_OEM = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM; /** *

This is the power optimized mode for 10-bit Dolby Vision HDR device specific capture * Mode.

*/ - public static final int DOLBY_VISION_10B_HDR_OEM_PO = + public static final long DOLBY_VISION_10B_HDR_OEM_PO = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_10B_HDR_OEM_PO; /** *

This is the 8-bit version of the Dolby Vision reference capture mode optimized * for scene accuracy.

*/ - public static final int DOLBY_VISION_8B_HDR_REF = + public static final long DOLBY_VISION_8B_HDR_REF = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF; /** *

This is the power optimized mode for 8-bit Dolby Vision HDR Reference Mode.

*/ - public static final int DOLBY_VISION_8B_HDR_REF_PO = + public static final long DOLBY_VISION_8B_HDR_REF_PO = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_REF_PO; /** *

This is the 8-bit version of device specific tuned and optimized Dolby Vision * capture mode.

*/ - public static final int DOLBY_VISION_8B_HDR_OEM = + public static final long DOLBY_VISION_8B_HDR_OEM = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM; /** *

This is the power optimized mode for 8-bit Dolby Vision HDR device specific * capture Mode.

*/ - public static final int DOLBY_VISION_8B_HDR_OEM_PO = + public static final long DOLBY_VISION_8B_HDR_OEM_PO = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO; /* * @hide */ - public static final int PUBLIC_MAX = + public static final long PUBLIC_MAX = CameraMetadata.REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_MAX; /** @hide */ @Retention(RetentionPolicy.SOURCE) - @IntDef(prefix = {"PROFILE_"}, value = + @LongDef(prefix = {"PROFILE_"}, value = {STANDARD, HLG10, HDR10, @@ -168,7 +167,8 @@ public final class DynamicRangeProfiles { public @interface Profile { } - private final HashMap> mProfileMap = new HashMap<>(); + private final HashMap> mProfileMap = new HashMap<>(); + private final HashMap mLookahedLatencyMap = new HashMap<>(); /** * Create a new immutable DynamicRangeProfiles instance. @@ -193,23 +193,23 @@ public final class DynamicRangeProfiles { * if {@code elements} is {@code null} * */ - public DynamicRangeProfiles(@NonNull final int[] elements) { - if ((elements.length % 2) != 0) { + public DynamicRangeProfiles(@NonNull final long[] elements) { + if ((elements.length % 3) != 0) { throw new IllegalArgumentException("Dynamic range profile map length " + elements.length + " is not even!"); } - for (int i = 0; i < elements.length; i += 2) { + for (int i = 0; i < elements.length; i += 3) { checkProfileValue(elements[i]); // STANDARD is not expected to be included if (elements[i] == STANDARD) { throw new IllegalArgumentException("Dynamic range profile map must not include a" + " STANDARD profile entry!"); } - HashSet profiles = new HashSet<>(); + HashSet profiles = new HashSet<>(); if (elements[i+1] != 0) { - for (int profile = STANDARD; profile < PUBLIC_MAX; profile <<= 1) { + for (long profile = STANDARD; profile < PUBLIC_MAX; profile <<= 1) { if ((elements[i+1] & profile) != 0) { profiles.add(profile); } @@ -217,12 +217,13 @@ public final class DynamicRangeProfiles { } mProfileMap.put(elements[i], profiles); + mLookahedLatencyMap.put(elements[i], elements[i+2] != 0L); } // Build the STANDARD constraints depending on the advertised 10-bit limitations - HashSet standardConstraints = new HashSet<>(); + HashSet standardConstraints = new HashSet<>(); standardConstraints.add(STANDARD); - for(Integer profile : mProfileMap.keySet()) { + for(Long profile : mProfileMap.keySet()) { if (mProfileMap.get(profile).isEmpty() || mProfileMap.get(profile).contains(STANDARD)) { standardConstraints.add(profile); } @@ -235,24 +236,15 @@ public final class DynamicRangeProfiles { /** * @hide */ - public static void checkProfileValue(int profile) { - switch (profile) { - case STANDARD: - case HLG10: - case HDR10: - case HDR10_PLUS: - case DOLBY_VISION_10B_HDR_REF: - case DOLBY_VISION_10B_HDR_REF_PO: - case DOLBY_VISION_10B_HDR_OEM: - case DOLBY_VISION_10B_HDR_OEM_PO: - case DOLBY_VISION_8B_HDR_REF: - case DOLBY_VISION_8B_HDR_REF_PO: - case DOLBY_VISION_8B_HDR_OEM: - case DOLBY_VISION_8B_HDR_OEM_PO: - //No-op - break; - default: - throw new IllegalArgumentException("Unknown profile " + profile); + public static void checkProfileValue(long profile) { + if (profile == STANDARD || profile == HLG10 || profile == HDR10 || profile == HDR10_PLUS + || profile == DOLBY_VISION_10B_HDR_REF || profile == DOLBY_VISION_10B_HDR_REF_PO + || profile == DOLBY_VISION_10B_HDR_OEM || profile == DOLBY_VISION_10B_HDR_OEM_PO + || profile == DOLBY_VISION_8B_HDR_REF || profile == DOLBY_VISION_8B_HDR_REF_PO + || profile == DOLBY_VISION_8B_HDR_OEM + || profile == DOLBY_VISION_8B_HDR_OEM_PO) {//No-op + } else { + throw new IllegalArgumentException("Unknown profile " + profile); } } @@ -261,7 +253,7 @@ public final class DynamicRangeProfiles { * * @return non-modifiable set of dynamic range profiles */ - public @NonNull Set getSupportedProfiles() { + public @NonNull Set getSupportedProfiles() { return Collections.unmodifiableSet(mProfileMap.keySet()); } @@ -272,7 +264,7 @@ public final class DynamicRangeProfiles { * *

For example if assume that a particular 10-bit output capable device * returns ({@link #STANDARD}, {@link #HLG10}, {@link #HDR10}) as result from calling - * {@link #getSupportedProfiles()} and {@link #getProfileCaptureRequestConstraints(int)} + * {@link #getSupportedProfiles()} and {@link #getProfileCaptureRequestConstraints} * returns ({@link #STANDARD}, {@link #HLG10}) when given an argument of {@link #STANDARD}. * This means that the corresponding camera device will only accept and process capture requests * that reference outputs configured using {@link #HDR10} dynamic profile or alternatively @@ -288,14 +280,40 @@ public final class DynamicRangeProfiles { * within the list returned by * getSupportedProfiles() * - * @see OutputConfiguration#setDynamicRangeProfile(int) + * @see OutputConfiguration#setDynamicRangeProfile */ - public @NonNull Set getProfileCaptureRequestConstraints(@Profile int profile) { - Set ret = mProfileMap.get(profile); + public @NonNull Set getProfileCaptureRequestConstraints(@Profile long profile) { + Set ret = mProfileMap.get(profile); if (ret == null) { throw new IllegalArgumentException("Unsupported profile!"); } return Collections.unmodifiableSet(ret); } + + /** + * Check whether a given dynamic range profile is suitable for latency sensitive use cases. + * + *

Due to internal lookahead logic, camera outputs configured with some dynamic range + * profiles may experience additional latency greater than 3 buffers. Using camera outputs + * with such profiles for latency sensitive use cases such as camera preview is not + * recommended. Profiles that have such extra streaming delay are typically utilized for + * scenarios such as offscreen video recording.

+ * + * @return true if the given profile is not suitable for latency sensitive use cases, false + * otherwise + * @throws IllegalArgumentException - If the profile argument is not + * within the list returned by + * getSupportedProfiles() + * + * @see OutputConfiguration#setDynamicRangeProfile + */ + public boolean isExtraLatencyPresent(@Profile long profile) { + Boolean ret = mLookahedLatencyMap.get(profile); + if (ret == null) { + throw new IllegalArgumentException("Unsupported profile!"); + } + + return ret; + } } diff --git a/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java b/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java index 8c0dcfcf06934..465abfb555404 100644 --- a/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java +++ b/core/java/android/hardware/camera2/params/MandatoryStreamCombination.java @@ -246,7 +246,7 @@ public final class MandatoryStreamCombination { * @return true if stream is able to output 10-bit pixels * * @see android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT - * @see OutputConfiguration#setDynamicRangeProfile(int) + * @see OutputConfiguration#setDynamicRangeProfile */ public boolean is10BitCapable() { return mIs10BitCapable; diff --git a/core/java/android/hardware/camera2/params/OutputConfiguration.java b/core/java/android/hardware/camera2/params/OutputConfiguration.java index 80937640e094e..2350b7c7a4813 100644 --- a/core/java/android/hardware/camera2/params/OutputConfiguration.java +++ b/core/java/android/hardware/camera2/params/OutputConfiguration.java @@ -421,7 +421,7 @@ public final class OutputConfiguration implements Parcelable { * {@link android.media.MediaCodec} etc.) * or {@link ImageFormat#YCBCR_P010}.

*/ - public void setDynamicRangeProfile(@Profile int profile) { + public void setDynamicRangeProfile(@Profile long profile) { mDynamicRangeProfile = profile; } @@ -430,7 +430,7 @@ public final class OutputConfiguration implements Parcelable { * * @return the currently set dynamic range profile */ - public @Profile int getDynamicRangeProfile() { + public @Profile long getDynamicRangeProfile() { return mDynamicRangeProfile; } @@ -1070,7 +1070,7 @@ public final class OutputConfiguration implements Parcelable { int streamUseCase = source.readInt(); checkArgumentInRange(rotation, ROTATION_0, ROTATION_270, "Rotation constant"); - int dynamicRangeProfile = source.readInt(); + long dynamicRangeProfile = source.readLong(); DynamicRangeProfiles.checkProfileValue(dynamicRangeProfile); int timestampBase = source.readInt(); @@ -1217,7 +1217,7 @@ public final class OutputConfiguration implements Parcelable { dest.writeInt(mIsMultiResolution ? 1 : 0); // writeList doesn't seem to work well with Integer list. dest.writeIntArray(convertIntegerToIntList(mSensorPixelModesUsed)); - dest.writeInt(mDynamicRangeProfile); + dest.writeLong(mDynamicRangeProfile); dest.writeInt(mStreamUseCase); dest.writeInt(mTimestampBase); dest.writeInt(mMirrorMode); @@ -1335,7 +1335,7 @@ public final class OutputConfiguration implements Parcelable { // The sensor pixel modes that this OutputConfiguration will use private ArrayList mSensorPixelModesUsed; // Dynamic range profile - private int mDynamicRangeProfile; + private long mDynamicRangeProfile; // Stream use case private int mStreamUseCase; // Timestamp base diff --git a/proto/src/camera.proto b/proto/src/camera.proto index 2d62f32d3941e..40821185b61af 100644 --- a/proto/src/camera.proto +++ b/proto/src/camera.proto @@ -64,7 +64,7 @@ message CameraStreamProto { repeated int64 histogram_counts = 13; // The dynamic range profile of the stream - optional int32 dynamic_range_profile = 14; + optional int64 dynamic_range_profile = 14; // The stream use case optional int32 stream_use_case = 15; }