From e7f205ca19033c9b227171915bf9f748b5eefe85 Mon Sep 17 00:00:00 2001 From: Tzah Mazuz Date: Thu, 12 Mar 2020 16:52:46 +0200 Subject: [PATCH] Adding codecProfile to server options (cherry picked from commit d4fb6a0c19af23d0d3c57721f6ccc91e4fad67f3) --- server/src/main/java/com/genymobile/scrcpy/Options.java | 9 +++++++++ server/src/main/java/com/genymobile/scrcpy/Server.java | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/genymobile/scrcpy/Options.java b/server/src/main/java/com/genymobile/scrcpy/Options.java index 5b993f30..e365e5a0 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Options.java +++ b/server/src/main/java/com/genymobile/scrcpy/Options.java @@ -10,6 +10,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; @@ -66,4 +67,12 @@ public class Options { public void setControl(boolean control) { this.control = control; } + + public int getCodecProfile() { + return codecProfile; + } + + public void setCodecProfile(int codecProfile) { + this.codecProfile = codecProfile; + } } diff --git a/server/src/main/java/com/genymobile/scrcpy/Server.java b/server/src/main/java/com/genymobile/scrcpy/Server.java index 56b738fb..1f3b281d 100644 --- a/server/src/main/java/com/genymobile/scrcpy/Server.java +++ b/server/src/main/java/com/genymobile/scrcpy/Server.java @@ -79,8 +79,8 @@ public final class Server { "The server version (" + clientVersion + ") does not match the client " + "(" + BuildConfig.VERSION_NAME + ")"); } - if (args.length != 8) { - throw new IllegalArgumentException("Expecting 8 parameters"); + if (args.length != 9) { + throw new IllegalArgumentException("Expecting 9 parameters"); } Options options = new Options(); @@ -107,6 +107,9 @@ public final class Server { boolean control = Boolean.parseBoolean(args[7]); options.setControl(control); + int codecProfile = Integer.parseInt(args[8]); + options.setCodecProfile(codecProfile); + return options; }