Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc99e920 authored by Tomoharu Kasahara's avatar Tomoharu Kasahara Committed by Lajos Molnar
Browse files

Make min/max sampling rate configurable

Platform may support lower or higher sample rate but
it's limited with the fixed value.
This change makes it possible to configure min/max
limit by system properties.

Bug: 30483830
Test: Use MediaCodecInfo for the codec which has higher
 sampling rate.

Change-Id: Ifb6da86d21b530fb908e68bdb71474aee4d1b581
parent cf263d95
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -24,6 +24,7 @@ import android.annotation.Nullable;
import android.annotation.TestApi;
import android.annotation.TestApi;
import android.annotation.UnsupportedAppUsage;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Build;
import android.os.SystemProperties;
import android.util.Log;
import android.util.Log;
import android.util.Pair;
import android.util.Pair;
import android.util.Range;
import android.util.Range;
@@ -1105,7 +1106,11 @@ public final class MediaCodecInfo {
            mBitrateRange = Range.create(0, Integer.MAX_VALUE);
            mBitrateRange = Range.create(0, Integer.MAX_VALUE);
            mMaxInputChannelCount = MAX_INPUT_CHANNEL_COUNT;
            mMaxInputChannelCount = MAX_INPUT_CHANNEL_COUNT;
            // mBitrateRange = Range.create(1, 320000);
            // mBitrateRange = Range.create(1, 320000);
            mSampleRateRanges = new Range[] { Range.create(8000, 96000) };
            final int minSampleRate = SystemProperties.
                getInt("ro.mediacodec.min_sample_rate", 7350);
            final int maxSampleRate = SystemProperties.
                getInt("ro.mediacodec.max_sample_rate", 192000);
            mSampleRateRanges = new Range[] { Range.create(minSampleRate, maxSampleRate) };
            mSampleRates = null;
            mSampleRates = null;
        }
        }