From 6b21f4ae13e0644632d2bef4f14ff590b1fa5e18 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 26 Jan 2022 10:29:06 +0100 Subject: [PATCH] Reorder scrcpy-server options Move the options unused by the scrcpy client at the end. These options may be useful to use scrcpy-server directly (to get a raw H.264 stream for example). PR #2971 --- .../java/com/genymobile/scrcpy/Options.java | 20 ++++++++++--------- .../java/com/genymobile/scrcpy/Server.java | 8 ++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Options.java b/server/src/main/java/com/genymobile/scrcpy/Options.java index ef7d8572..236a93d7 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Options.java +++ b/server/src/main/java/com/genymobile/scrcpy/Options.java @@ -12,7 +12,6 @@ public class Options { private int lockVideoOrientation = -1; private boolean tunnelForward; private Rect crop; - private boolean sendFrameMeta = true; // send PTS so that the client may record properly private boolean control = true; private int displayId; private boolean showTouches; @@ -23,6 +22,9 @@ public class Options { private boolean clipboardAutosync = true; private boolean downsizeOnError = true; + // Options not used by the scrcpy client, but useful to use scrcpy-server directly + private boolean sendFrameMeta = true; // send PTS so that the client may record properly + public Ln.Level getLogLevel() { return logLevel; } @@ -79,14 +81,6 @@ public class Options { this.crop = crop; } - public boolean getSendFrameMeta() { - return sendFrameMeta; - } - - public void setSendFrameMeta(boolean sendFrameMeta) { - this.sendFrameMeta = sendFrameMeta; - } - public boolean getControl() { return control; } @@ -158,4 +152,12 @@ public class Options { public void setDownsizeOnError(boolean downsizeOnError) { this.downsizeOnError = downsizeOnError; } + + public boolean getSendFrameMeta() { + return sendFrameMeta; + } + + public void setSendFrameMeta(boolean sendFrameMeta) { + this.sendFrameMeta = sendFrameMeta; + } } diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index 6dc0b2c6..e690a45b 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -201,10 +201,6 @@ public final class Server { Rect crop = parseCrop(value); options.setCrop(crop); break; - case "send_frame_meta": - boolean sendFrameMeta = Boolean.parseBoolean(value); - options.setSendFrameMeta(sendFrameMeta); - break; case "control": boolean control = Boolean.parseBoolean(value); options.setControl(control); @@ -242,6 +238,10 @@ public final class Server { boolean downsizeOnError = Boolean.parseBoolean(value); options.setDownsizeOnError(downsizeOnError); break; + case "send_frame_meta": + boolean sendFrameMeta = Boolean.parseBoolean(value); + options.setSendFrameMeta(sendFrameMeta); + break; default: Ln.w("Unknown server option: " + key); break;