From 2bff4f0027762eacc75c65e6ac7275e27c89b426 Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Mon, 17 Nov 2014 17:50:38 +0100 Subject: [PATCH] Use new StreamConfiguration builder --- src/com/limelight/Limelight.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/com/limelight/Limelight.java b/src/com/limelight/Limelight.java index fb0a98b..239c61c 100644 --- a/src/com/limelight/Limelight.java +++ b/src/com/limelight/Limelight.java @@ -172,15 +172,12 @@ public class Limelight implements NvConnectionListener { public static void main(String args[]) { InetAddress host = null; List inputs = new ArrayList(); + StreamConfiguration.Builder builder = new StreamConfiguration.Builder(); int width = 1280; int height = 720; - int refresh = 60; - int bitrate = 10000; boolean parse = true; boolean tests = true; - boolean sops = true; String mapping = null; - String app = "Steam"; String audio = "sysdefault"; String video = null; String action = null; @@ -245,13 +242,13 @@ public class Limelight implements NvConnectionListener { System.exit(3); } } else if (args[i].equals("-30fps")) { - refresh = 30; + builder.setRefreshRate(30); } else if (args[i].equals("-60fps")) { - refresh = 60; + builder.setRefreshRate(60); } else if (args[i].equals("-bitrate")) { if (i + 1 < args.length) { try { - bitrate = Integer.parseInt(args[i+1]); + builder.setBitrate(Integer.parseInt(args[i+1])); } catch (NumberFormatException e) { System.out.println("Syntax error: bitrate must be a number"); System.exit(3); @@ -271,7 +268,7 @@ public class Limelight implements NvConnectionListener { } } else if (args[i].equals("-app")) { if (i + 1 < args.length) { - app = args[i+1]; + builder.setApp(args[i+1]); i++; } else { 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")) { tests = false; } else if (args[i].equals("-nosops")) { - sops = false; + builder.setEnableSops(false); } else if (args[i].equals("-v")) { debug = Level.WARNING; } else if (args[i].equals("-vv")) { @@ -309,6 +306,8 @@ public class Limelight implements NvConnectionListener { } } + builder.setResolution(width, height); + if (action == null) { System.out.println("Syntax Error: Missing required action argument"); parse = false; @@ -384,7 +383,7 @@ public class Limelight implements NvConnectionListener { } 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")) limelight.startUpFake(streamConfig, video);