chenxuanyu
chenxuanyu
in Scrcpy server code, does mirror mian display in android 14,so it show black screen. should use SurfaceComposerClient call mirrorDisplay function. and setLayerStack for the mirror screen
this is my test code: create a surface . run on main display. but not show in scrcpy ```cpp sp surfaceControl = client->createSurface(String8("TestSurface"), 3000, 3000, PIXEL_FORMAT_RGB_565, 0); sp surface =...
my suggest code is : 1、set scrcpy virtualdisplay layerStack 2、also set the layerStack to mirrordisplay sp client = SurfaceComposerClient::getDefault(); sp surface; surface = client->mirrorDisplay(maindisplayid); SurfaceComposerClient::Transaction t; t.setLayerStack(surface, ui::LayerStack::fromValue(layerStack)); t.apply();
```diff --- a/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java +++ b/server/src/main/java/com/genymobile/scrcpy/ScreenCapture.java @@ -43,11 +43,15 @@ public class ScreenCapture extends SurfaceCapture implements Device.RotationList virtualDisplay.release(); virtualDisplay = null; } try { display = createDisplay(); setDisplaySurface(display, surface, videoRotation, contentRect,...