Skip to content

Commit

Permalink
Re-enable the max operating rate trick on Android 10 except on the Mi…
Browse files Browse the repository at this point in the history
… 10 Lite 5G

It still provides nice performance gains on Pixel 2 running Android 10
  • Loading branch information
cgutman committed Jul 11, 2020
1 parent 4aabfbd commit 4c5c27d
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,12 +359,14 @@ public static boolean decoderSupportsMaxOperatingRate(String decoderName) {
// some Qualcomm platforms. We could also set KEY_PRIORITY to 0 (realtime)
// but that will actually result in the decoder crashing if it can't satisfy
// our (ludicrous) operating rate requirement. This seems to cause reliable
// crashes on the Xiaomi Mi 10 lite 5G on Android 10, and probably isn't too
// useful in light of the qti-ext-dec-low-latency code. To be safe, we'll
// disable it on devices running Q or non-Qualcomm devices.
// crashes on the Xiaomi Mi 10 lite 5G on Android 10, so we'll disable it
// on that device and all non-Qualcomm devices to be safe.
//
// NB: Even on Android 10, this optimization still provides significant
// performance gains on Pixel 2.
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.Q &&
isDecoderInList(qualcommDecoderPrefixes, decoderName);
isDecoderInList(qualcommDecoderPrefixes, decoderName) &&
!Build.DEVICE.equalsIgnoreCase("monet");
}

public static boolean decoderSupportsAdaptivePlayback(MediaCodecInfo decoderInfo, String mimeType) {
Expand Down

0 comments on commit 4c5c27d

Please sign in to comment.