summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/current.txt4
-rw-r--r--media/java/android/media/MediaCodecInfo.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index 5b639ff0b00f..4ec2eadff1a3 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -21300,8 +21300,8 @@ package android.media {
public static final class MediaCodecInfo.AudioCapabilities {
method public android.util.Range<java.lang.Integer> getBitrateRange();
method @NonNull public android.util.Range<java.lang.Integer>[] getInputChannelCountRanges();
- method public int getMaxInputChannelCount();
- method public int getMinInputChannelCount();
+ method @IntRange(from=1, to=255) public int getMaxInputChannelCount();
+ method @IntRange(from=1, to=255) public int getMinInputChannelCount();
method public android.util.Range<java.lang.Integer>[] getSupportedSampleRateRanges();
method public int[] getSupportedSampleRates();
method public boolean isSampleRateSupported(int);
diff --git a/media/java/android/media/MediaCodecInfo.java b/media/java/android/media/MediaCodecInfo.java
index 4d7ed1145990..06d0eb0b5423 100644
--- a/media/java/android/media/MediaCodecInfo.java
+++ b/media/java/android/media/MediaCodecInfo.java
@@ -19,6 +19,7 @@ package android.media;
import static android.media.Utils.intersectSortedDistinctRanges;
import static android.media.Utils.sortDistinctRanges;
+import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
@@ -1133,6 +1134,7 @@ public final class MediaCodecInfo {
* in the ranges returned by {@link #getInputChannelCountRanges}
*
*/
+ @IntRange(from = 1, to = 255)
public int getMaxInputChannelCount() {
int overall_max = 0;
for (int i = mInputChannelRanges.length - 1; i >= 0; i--) {
@@ -1151,6 +1153,7 @@ public final class MediaCodecInfo {
* This returns the lowest channel count in the ranges returned by
* {@link #getInputChannelCountRanges}.
*/
+ @IntRange(from = 1, to = 255)
public int getMinInputChannelCount() {
int overall_min = MAX_INPUT_CHANNEL_COUNT;
for (int i = mInputChannelRanges.length - 1; i >= 0; i--) {