From 8edfaf5a31c793788b6782f1debdd88efe53a8ee Mon Sep 17 00:00:00 2001 From: Iwan Timmer Date: Wed, 7 May 2014 21:40:46 +0200 Subject: [PATCH] Update for GFE 2.0.1 --- libs/common | 2 +- src/com/limelight/Limelight.java | 27 ++++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/libs/common b/libs/common index 4b2c87a..9868596 160000 --- a/libs/common +++ b/libs/common @@ -1 +1 @@ -Subproject commit 4b2c87a0e862e50c5156cb9a229fe4be55fad169 +Subproject commit 986859604033e889436ef59ee01dde9ee8c2f1ea diff --git a/src/com/limelight/Limelight.java b/src/com/limelight/Limelight.java index a02d74c..d35c4f4 100644 --- a/src/com/limelight/Limelight.java +++ b/src/com/limelight/Limelight.java @@ -163,6 +163,7 @@ public class Limelight implements NvConnectionListener { boolean pair = false; int resolution = 720; int refresh = 60; + int bitrate = 0; boolean parse = true; boolean fake = false; boolean tests = true; @@ -205,6 +206,20 @@ public class Limelight implements NvConnectionListener { refresh = 30; } else if (args[i].equals("-60fps")) { refresh = 60; + } else if (args[i].equals("-bitrate")) { + if (i + 1 < args.length) { + try { + bitrate = Integer.parseInt(args[i+1]); + } catch (NumberFormatException e) { + System.out.println("Syntax error: bitrate must be a number"); + System.exit(3); + } + i++; + } else { + System.out.println("Syntax error: bitrate expected after -bitrate"); + System.exit(3); + } + refresh = 30; } else if (args[i].equals("-fake")) { fake = true; } else if (args[i].equals("-notest")) { @@ -225,6 +240,7 @@ public class Limelight implements NvConnectionListener { System.out.println("\t-1080\t\tUse 1920x1080 resolution"); System.out.println("\t-30fps\t\tUse 30fps"); System.out.println("\t-60fps\t\tUse 60fps [default]"); + System.out.println("\t-bitrate \t\tSpecify the bitrate in Kbps"); System.out.println("\t-input \tUse as input. Can be used multiple times"); System.out.println("\t\t\t[default uses all devices in /dev/input]"); System.out.println("\t-mapping \tUse as gamepad mapping configuration file"); @@ -236,10 +252,19 @@ public class Limelight implements NvConnectionListener { } else host = args[args.length-1]; + if (bitrate == 0) { + if (resolution==720) + bitrate = 10000; + else if (refresh==30) + bitrate = 15000; + else + bitrate = 25000; + } + //Set debugging level Logger.getLogger(LimeLog.class.getName()).setLevel(debug); - StreamConfiguration streamConfig = new StreamConfiguration((resolution/9)*16, resolution, refresh); + StreamConfiguration streamConfig = new StreamConfiguration((resolution/9)*16, resolution, refresh, bitrate); Limelight limelight = new Limelight(host); if (!pair)