mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-06 07:56:07 +00:00
Add battery saver mode
This commit is contained in:
@@ -109,12 +109,18 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer {
|
||||
this.renderTarget = renderTarget;
|
||||
}
|
||||
|
||||
public MediaCodecDecoderRenderer(int videoFormat, int bitrate) {
|
||||
public MediaCodecDecoderRenderer(int videoFormat, int bitrate, boolean batterySaver) {
|
||||
//dumpDecoders();
|
||||
|
||||
this.bitrate = bitrate;
|
||||
|
||||
spinnerThreads = new Thread[Runtime.getRuntime().availableProcessors()];
|
||||
// Disable spinner threads in battery saver mode
|
||||
if (batterySaver) {
|
||||
spinnerThreads = new Thread[0];
|
||||
}
|
||||
else {
|
||||
spinnerThreads = new Thread[Runtime.getRuntime().availableProcessors()];
|
||||
}
|
||||
|
||||
avcDecoder = findAvcDecoder();
|
||||
if (avcDecoder != null) {
|
||||
|
||||
Reference in New Issue
Block a user