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 <https://github.com/Genymobile/scrcpy/pull/2971>
This commit is contained in:
Romain Vimont 2022-01-26 10:29:06 +01:00
parent 31a5d0c2bf
commit 6b21f4ae13
2 changed files with 15 additions and 13 deletions

View file

@ -12,7 +12,6 @@ public class Options {
private int lockVideoOrientation = -1; private int lockVideoOrientation = -1;
private boolean tunnelForward; private boolean tunnelForward;
private Rect crop; private Rect crop;
private boolean sendFrameMeta = true; // send PTS so that the client may record properly
private boolean control = true; private boolean control = true;
private int displayId; private int displayId;
private boolean showTouches; private boolean showTouches;
@ -23,6 +22,9 @@ public class Options {
private boolean clipboardAutosync = true; private boolean clipboardAutosync = true;
private boolean downsizeOnError = 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() { public Ln.Level getLogLevel() {
return logLevel; return logLevel;
} }
@ -79,14 +81,6 @@ public class Options {
this.crop = crop; this.crop = crop;
} }
public boolean getSendFrameMeta() {
return sendFrameMeta;
}
public void setSendFrameMeta(boolean sendFrameMeta) {
this.sendFrameMeta = sendFrameMeta;
}
public boolean getControl() { public boolean getControl() {
return control; return control;
} }
@ -158,4 +152,12 @@ public class Options {
public void setDownsizeOnError(boolean downsizeOnError) { public void setDownsizeOnError(boolean downsizeOnError) {
this.downsizeOnError = downsizeOnError; this.downsizeOnError = downsizeOnError;
} }
public boolean getSendFrameMeta() {
return sendFrameMeta;
}
public void setSendFrameMeta(boolean sendFrameMeta) {
this.sendFrameMeta = sendFrameMeta;
}
} }

View file

@ -201,10 +201,6 @@ public final class Server {
Rect crop = parseCrop(value); Rect crop = parseCrop(value);
options.setCrop(crop); options.setCrop(crop);
break; break;
case "send_frame_meta":
boolean sendFrameMeta = Boolean.parseBoolean(value);
options.setSendFrameMeta(sendFrameMeta);
break;
case "control": case "control":
boolean control = Boolean.parseBoolean(value); boolean control = Boolean.parseBoolean(value);
options.setControl(control); options.setControl(control);
@ -242,6 +238,10 @@ public final class Server {
boolean downsizeOnError = Boolean.parseBoolean(value); boolean downsizeOnError = Boolean.parseBoolean(value);
options.setDownsizeOnError(downsizeOnError); options.setDownsizeOnError(downsizeOnError);
break; break;
case "send_frame_meta":
boolean sendFrameMeta = Boolean.parseBoolean(value);
options.setSendFrameMeta(sendFrameMeta);
break;
default: default:
Ln.w("Unknown server option: " + key); Ln.w("Unknown server option: " + key);
break; break;