mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-26 22:43:05 +00:00
Avoid using max operating rate on Android Q and non-Qualcomm devices
This commit is contained in:
parent
2d9915e43a
commit
43c67b4939
@ -334,12 +334,10 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
|||||||
videoFormat.setInteger("vendor.qti-ext-dec-low-latency.enable", 1);
|
videoFormat.setInteger("vendor.qti-ext-dec-low-latency.enable", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Operate at maximum rate to lower latency as much as possible on
|
if (MediaCodecHelper.decoderSupportsMaxOperatingRate(selectedDecoderName)) {
|
||||||
// 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.
|
|
||||||
videoFormat.setInteger(MediaFormat.KEY_OPERATING_RATE, Short.MAX_VALUE);
|
videoFormat.setInteger(MediaFormat.KEY_OPERATING_RATE, Short.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
configuredFormat = videoFormat;
|
configuredFormat = videoFormat;
|
||||||
LimeLog.info("Configuring with format: "+configuredFormat);
|
LimeLog.info("Configuring with format: "+configuredFormat);
|
||||||
|
@ -354,6 +354,19 @@ public class MediaCodecHelper {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean decoderSupportsMaxOperatingRate(String decoderName) {
|
||||||
|
// Operate at maximum rate to lower latency as much as possible on
|
||||||
|
// 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.
|
||||||
|
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
|
||||||
|
Build.VERSION.SDK_INT < Build.VERSION_CODES.Q &&
|
||||||
|
isDecoderInList(qualcommDecoderPrefixes, decoderName);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean decoderSupportsAdaptivePlayback(MediaCodecInfo decoderInfo, String mimeType) {
|
public static boolean decoderSupportsAdaptivePlayback(MediaCodecInfo decoderInfo, String mimeType) {
|
||||||
// Possibly enable adaptive playback on KitKat and above
|
// Possibly enable adaptive playback on KitKat and above
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user