mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-08-30 14:00:46 +00:00
Use new StreamConfiguration builder
This commit is contained in:
@@ -172,15 +172,12 @@ public class Limelight implements NvConnectionListener {
|
|||||||
public static void main(String args[]) {
|
public static void main(String args[]) {
|
||||||
InetAddress host = null;
|
InetAddress host = null;
|
||||||
List<String> inputs = new ArrayList<String>();
|
List<String> inputs = new ArrayList<String>();
|
||||||
|
StreamConfiguration.Builder builder = new StreamConfiguration.Builder();
|
||||||
int width = 1280;
|
int width = 1280;
|
||||||
int height = 720;
|
int height = 720;
|
||||||
int refresh = 60;
|
|
||||||
int bitrate = 10000;
|
|
||||||
boolean parse = true;
|
boolean parse = true;
|
||||||
boolean tests = true;
|
boolean tests = true;
|
||||||
boolean sops = true;
|
|
||||||
String mapping = null;
|
String mapping = null;
|
||||||
String app = "Steam";
|
|
||||||
String audio = "sysdefault";
|
String audio = "sysdefault";
|
||||||
String video = null;
|
String video = null;
|
||||||
String action = null;
|
String action = null;
|
||||||
@@ -245,13 +242,13 @@ public class Limelight implements NvConnectionListener {
|
|||||||
System.exit(3);
|
System.exit(3);
|
||||||
}
|
}
|
||||||
} else if (args[i].equals("-30fps")) {
|
} else if (args[i].equals("-30fps")) {
|
||||||
refresh = 30;
|
builder.setRefreshRate(30);
|
||||||
} else if (args[i].equals("-60fps")) {
|
} else if (args[i].equals("-60fps")) {
|
||||||
refresh = 60;
|
builder.setRefreshRate(60);
|
||||||
} else if (args[i].equals("-bitrate")) {
|
} else if (args[i].equals("-bitrate")) {
|
||||||
if (i + 1 < args.length) {
|
if (i + 1 < args.length) {
|
||||||
try {
|
try {
|
||||||
bitrate = Integer.parseInt(args[i+1]);
|
builder.setBitrate(Integer.parseInt(args[i+1]));
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
System.out.println("Syntax error: bitrate must be a number");
|
System.out.println("Syntax error: bitrate must be a number");
|
||||||
System.exit(3);
|
System.exit(3);
|
||||||
@@ -271,7 +268,7 @@ public class Limelight implements NvConnectionListener {
|
|||||||
}
|
}
|
||||||
} else if (args[i].equals("-app")) {
|
} else if (args[i].equals("-app")) {
|
||||||
if (i + 1 < args.length) {
|
if (i + 1 < args.length) {
|
||||||
app = args[i+1];
|
builder.setApp(args[i+1]);
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Syntax error: application name expected after -app");
|
System.out.println("Syntax error: application name expected after -app");
|
||||||
@@ -280,7 +277,7 @@ public class Limelight implements NvConnectionListener {
|
|||||||
} else if (args[i].equals("-notest")) {
|
} else if (args[i].equals("-notest")) {
|
||||||
tests = false;
|
tests = false;
|
||||||
} else if (args[i].equals("-nosops")) {
|
} else if (args[i].equals("-nosops")) {
|
||||||
sops = false;
|
builder.setEnableSops(false);
|
||||||
} else if (args[i].equals("-v")) {
|
} else if (args[i].equals("-v")) {
|
||||||
debug = Level.WARNING;
|
debug = Level.WARNING;
|
||||||
} else if (args[i].equals("-vv")) {
|
} else if (args[i].equals("-vv")) {
|
||||||
@@ -309,6 +306,8 @@ public class Limelight implements NvConnectionListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder.setResolution(width, height);
|
||||||
|
|
||||||
if (action == null) {
|
if (action == null) {
|
||||||
System.out.println("Syntax Error: Missing required action argument");
|
System.out.println("Syntax Error: Missing required action argument");
|
||||||
parse = false;
|
parse = false;
|
||||||
@@ -384,7 +383,7 @@ public class Limelight implements NvConnectionListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action.equals("stream") || action.equals("fake")) {
|
if (action.equals("stream") || action.equals("fake")) {
|
||||||
StreamConfiguration streamConfig = new StreamConfiguration(app, width, height, refresh, bitrate, sops, false);
|
StreamConfiguration streamConfig = builder.build();
|
||||||
|
|
||||||
if (action.equals("fake"))
|
if (action.equals("fake"))
|
||||||
limelight.startUpFake(streamConfig, video);
|
limelight.startUpFake(streamConfig, video);
|
||||||
|
|||||||
Reference in New Issue
Block a user