Skip to content

Commit

Permalink
Adding codecProfile to server options
Browse files Browse the repository at this point in the history
(cherry picked from commit d4fb6a0)
(cherry picked from commit e7f205c)
(cherry picked from commit ef5d72c)
  • Loading branch information
Tzah Mazuz committed Mar 19, 2020
1 parent 504d6a4 commit 709a0c3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
9 changes: 9 additions & 0 deletions server/src/main/java/com/genymobile/scrcpy/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Options {
private Rect crop;
private boolean sendFrameMeta; // send PTS so that the client may record properly
private boolean control;
private int codecProfile;

public int getMaxSize() {
return maxSize;
Expand Down Expand Up @@ -75,4 +76,12 @@ public boolean getControl() {
public void setControl(boolean control) {
this.control = control;
}

public int getCodecProfile() {
return codecProfile;
}

public void setCodecProfile(int codecProfile) {
this.codecProfile = codecProfile;
}
}
15 changes: 9 additions & 6 deletions server/src/main/java/com/genymobile/scrcpy/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ private static Options createOptions(String... args) {
"The server version (" + clientVersion + ") does not match the client " + "(" + BuildConfig.VERSION_NAME + ")");
}

if (args.length != 9) {
throw new IllegalArgumentException("Expecting 9 parameters");
if (args.length != 10) {
throw new IllegalArgumentException("Expecting 10 parameters");
}

Options options = new Options();
Expand All @@ -98,17 +98,20 @@ private static Options createOptions(String... args) {
int lockedVideoOrientation = Integer.parseInt(args[4]);
options.setLockedVideoOrientation(lockedVideoOrientation);

int codecProfile = Integer.parseInt(args[5]);
options.setCodecProfile(codecProfile);

// use "adb forward" instead of "adb tunnel"? (so the server must listen)
boolean tunnelForward = Boolean.parseBoolean(args[5]);
boolean tunnelForward = Boolean.parseBoolean(args[6]);
options.setTunnelForward(tunnelForward);

Rect crop = parseCrop(args[6]);
Rect crop = parseCrop(args[7]);
options.setCrop(crop);

boolean sendFrameMeta = Boolean.parseBoolean(args[7]);
boolean sendFrameMeta = Boolean.parseBoolean(args[8]);
options.setSendFrameMeta(sendFrameMeta);

boolean control = Boolean.parseBoolean(args[8]);
boolean control = Boolean.parseBoolean(args[9]);
options.setControl(control);

return options;
Expand Down

0 comments on commit 709a0c3

Please sign in to comment.