Can save videostream to file in debug mode

This commit is contained in:
Iwan Timmer
2014-03-31 17:15:12 +02:00
parent 4d3d5ee028
commit e6d6e0ef16
2 changed files with 45 additions and 3 deletions

View File

@@ -117,12 +117,12 @@ public class Limelight implements NvConnectionListener {
/*
* Creates a connection to the host and starts up the stream.
*/
private void startUpFake(StreamConfiguration streamConfig) {
private void startUpFake(StreamConfiguration streamConfig, String videoFile) {
conn = new NvConnection(host, this, streamConfig);
conn.start(PlatformBinding.getDeviceName(), null,
VideoDecoderRenderer.FLAG_PREFER_QUALITY,
new FakeAudioRenderer(),
new FakeVideoRenderer());
new FakeVideoRenderer(videoFile));
}
/**
@@ -184,6 +184,7 @@ public class Limelight implements NvConnectionListener {
boolean tests = true;
String mapping = null;
String audio = "hw:0,0";
String video = null;
Level debug = Level.SEVERE;
for (int i = 0; i < args.length - 1; i++) {
@@ -223,6 +224,14 @@ public class Limelight implements NvConnectionListener {
refresh = 60;
} else if (args[i].equals("-fake")) {
fake = true;
} else if (args[i].equals("-out")) {
if (i + 1 < args.length) {
video = args[i+1];
i++;
} else {
System.out.println("Syntax error: output file expected after -out");
System.exit(3);
}
} else if (args[i].equals("-notest")) {
tests = false;
} else if (args[i].equals("-v")) {
@@ -260,7 +269,7 @@ public class Limelight implements NvConnectionListener {
Limelight limelight = new Limelight(host);
if (!pair)
if (fake)
limelight.startUpFake(streamConfig);
limelight.startUpFake(streamConfig, video);
else
limelight.startUp(streamConfig, inputs, mapping, audio, tests);
else