mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Set MediaCodec KEY_PRIORITY to real-time (0)
Refs <https://developer.android.com/reference/android/media/MediaFormat#KEY_PRIORITY> Refs #6238 comment <https://github.com/Genymobile/scrcpy/issues/6238#issuecomment-3828402687> PR #6670 <https://github.com/Genymobile/scrcpy/pull/6670>
This commit is contained in:
parent
8b0206f7be
commit
1f19ec4aec
1 changed files with 2 additions and 0 deletions
|
|
@ -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 frames
|
||||
format.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/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue