From b0f78edaca72c3008942cdefe66b80810ecd1f4a Mon Sep 17 00:00:00 2001 From: olbb Date: Tue, 19 Feb 2019 10:33:59 +0800 Subject: [PATCH] fix:Add Support For Meizu Phone Fix the error case by flyme nightMode. issue #1 --- server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java index ec63e81d33..2779d4cb16 100644 --- a/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenEncoder.java @@ -8,6 +8,7 @@ import android.media.MediaCodecInfo; import android.media.MediaFormat; import android.os.IBinder; +import android.os.Looper; import android.view.Surface; import java.io.FileDescriptor; @@ -66,6 +67,7 @@ public void streamScreen(Device device, FileDescriptor fd) throws IOException { Rect videoRect = device.getScreenInfo().getVideoSize().toRect(); setSize(format, videoRect.width(), videoRect.height()); configure(codec, format); + Looper.prepare(); Surface surface = codec.createInputSurface(); setDisplaySurface(display, surface, contentRect, videoRect); codec.start();