Skip to content

Commit

Permalink
Make tests mandatory for running Limelight
Browse files Browse the repository at this point in the history
  • Loading branch information
irtimmer committed Feb 18, 2014
1 parent 25562f2 commit 7921aa8
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions src/com/limelight/Limelight.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,26 @@ public Limelight(String host) {
/*
* Creates a connection to the host and starts up the stream.
*/
private void startUp(StreamConfiguration streamConfig, List<String> inputs, String mappingFile, String audioDevice) {
String vm = System.getProperties().getProperty("java.vm.name");
if (!vm.contains("HotSpot")) {
System.err.println("You are using a unsupported VM: " + vm);
System.err.println("Please update to Oracle Java (Embedded) for better performances");
}
String display = System.getenv("DISPLAY");
if (display!=null) {
System.err.println("X server is propably running");
System.err.println("Please exit the X server for a lower latency");
private void startUp(StreamConfiguration streamConfig, List<String> inputs, String mappingFile, String audioDevice, boolean tests) {
if (tests) {
boolean test = true;
String vm = System.getProperties().getProperty("java.vm.name");
if (!vm.contains("HotSpot")) {
System.err.println("You are using a unsupported VM: " + vm);
System.err.println("Please update to Oracle Java (Embedded) for better performances");
test = false;
}
String display = System.getenv("DISPLAY");
if (display!=null) {
System.err.println("X server is propably running");
System.err.println("Please exit the X server for a lower latency");
test = false;
}

if (!test) {
System.err.println("Fix problems or start application with parameter -notest");
return;
}
}

conn = new NvConnection(host, this, streamConfig);
Expand Down Expand Up @@ -171,6 +181,7 @@ public static void main(String args[]) {
int refresh = 60;
boolean parse = true;
boolean fake = false;
boolean tests = true;
String mapping = null;
String audio = "hw:0,0";
Level debug = Level.SEVERE;
Expand Down Expand Up @@ -212,6 +223,8 @@ public static void main(String args[]) {
refresh = 60;
} else if (args[i].equals("-fake")) {
fake = true;
} else if (args[i].equals("-notest")) {
tests = false;
} else if (args[i].equals("-v")) {
debug = Level.WARNING;
} else if (args[i].equals("-vv")) {
Expand Down Expand Up @@ -249,7 +262,7 @@ public static void main(String args[]) {
if (fake)
limelight.startUpFake(streamConfig);
else
limelight.startUp(streamConfig, inputs, mapping, audio);
limelight.startUp(streamConfig, inputs, mapping, audio, tests);
else
limelight.pair();
}
Expand Down

0 comments on commit 7921aa8

Please sign in to comment.