Merge "Add @IntRange() to audio encoding capability apis" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-02-26 22:39:53 +00:00
committed by Android (Google) Code Review
2 changed files with 5 additions and 2 deletions

View File

@@ -21296,8 +21296,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);

View File

@@ -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--) {