diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index 270751f3..5688c385 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -94,7 +94,7 @@ public class ScreenEncoder implements Device.RotationListener { Surface surface = null; try { - configure(codec, format); + codec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); surface = codec.createInputSurface(); setDisplaySurface(display, surface, videoRotation, contentRect, unlockedVideoRect, layerStack); codec.start(); @@ -279,10 +279,6 @@ public class ScreenEncoder implements Device.RotationListener { return SurfaceControl.createDisplay("scrcpy", secure); } - private static void configure(MediaCodec codec, MediaFormat format) { - codec.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE); - } - private static void setSize(MediaFormat format, int width, int height) { format.setInteger(MediaFormat.KEY_WIDTH, width); format.setInteger(MediaFormat.KEY_HEIGHT, height);