Display and control your Android device
Set MediaCodec KEY_PRIORITY to real-time (0)
Romain Vimont1f19ec4aec5a
diff --git a/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java b/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.javaindex 461ba472..39ad273d 100644--- a/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java+++ b/server/src/main/java/com/genymobile/scrcpy/video/SurfaceEncoder.java@@ -264,6 +264,8 @@ public class SurfaceEncoder implements AsyncProcessor {format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, DEFAULT_I_FRAME_INTERVAL);// display the very first frame, and recover from bad quality when no new framesformat.setLong(MediaFormat.KEY_REPEAT_PREVIOUS_FRAME_AFTER, REPEAT_FRAME_DELAY_US); // µs+ // real-time priority+ format.setInteger(MediaFormat.KEY_PRIORITY, 0);if (maxFps > 0) {// The key existed privately before Android 10:// <https://android.googlesource.com/platform/frameworks/base/+/625f0aad9f7a259b6881006ad8710adce57d1384%5E%21/>