aboutsummaryrefslogtreecommitdiffstats
path: root/src/demos/com/jogamp/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/demos/com/jogamp/opengl')
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieCube.java16
-rw-r--r--src/demos/com/jogamp/opengl/demos/av/MovieSimple.java43
2 files changed, 20 insertions, 39 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
index c2cae3e2b..ace46883a 100644
--- a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java
@@ -500,7 +500,8 @@ public class MovieCube implements GLEventListener {
int aid = GLMediaPlayer.STREAM_ID_AUTO;
final boolean origSize;
- String url_s=null, file_s=null;
+ String url_s=null;
+ final String file_s=null;
{
boolean _origSize = false;
for(int i=0; i<args.length; i++) {
@@ -524,9 +525,6 @@ public class MovieCube implements GLEventListener {
} else if(args[i].equals("-url")) {
i++;
url_s = args[i];
- } else if(args[i].equals("-file")) {
- i++;
- file_s = args[i];
} else if(args[i].equals("-es2")) {
forceES2 = true;
} else if(args[i].equals("-es3")) {
@@ -544,16 +542,14 @@ public class MovieCube implements GLEventListener {
}
origSize = _origSize;
}
- final Uri streamLoc;
+ Uri streamLoc = null;
if( null != url_s ) {
- streamLoc = Uri.cast( url_s );
- } else if( null != file_s ) {
- streamLoc = Uri.valueOf(new File(file_s));
- } else {
+ streamLoc = Uri.tryUriOrFile( url_s );
+ }
+ if( null == streamLoc ) {
streamLoc = defURI;
}
System.err.println("url_s "+url_s);
- System.err.println("file_s "+file_s);
System.err.println("stream "+streamLoc);
System.err.println("vid "+vid+", aid "+aid);
System.err.println("textureCount "+textureCount);
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
index 84e99ad15..13c329504 100644
--- a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
+++ b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java
@@ -675,19 +675,19 @@ public class MovieSimple implements GLEventListener {
final int windowCount;
{
- int _windowCount = 1;
+ int _windowCount = 0;
for(int i=0; i<args.length; i++) {
- if(args[i].equals("-windows")) {
+ if(args[i].equals("-url")) {
i++;
- _windowCount = MiscUtils.atoi(args[i], _windowCount);
+ _windowCount++;
}
}
- windowCount = _windowCount;
+ windowCount = Math.max(1, _windowCount);
}
final String[] urls_s = new String[windowCount];
- String file_s1=null, file_s2=null;
{
boolean _origSize = false;
+ int url_idx = 0;
for(int i=0; i<args.length; i++) {
if(args[i].equals("-vid")) {
i++;
@@ -723,39 +723,23 @@ public class MovieSimple implements GLEventListener {
useOrigScale=true;
} else if(args[i].equals("-loop")) {
loopEOS=true;
- } else if(args[i].equals("-urlN")) {
- i++;
- final int n = MiscUtils.atoi(args[i], 0);
- i++;
- urls_s[n] = args[i];
} else if(args[i].equals("-url")) {
i++;
- urls_s[0] = args[i];
- } else if(args[i].equals("-file1")) {
- i++;
- file_s1 = args[i];
- } else if(args[i].equals("-file2")) {
- i++;
- file_s2 = args[i];
+ urls_s[url_idx++] = args[i];
} else if(args[i].equals("-wait")) {
waitForKey = true;
}
}
origSize = _origSize;
}
- final Uri streamLoc0;
+ Uri streamLoc0 = null;
if( null != urls_s[0] ) {
- streamLoc0 = Uri.cast( urls_s[0] );
- } else if( null != file_s1 ) {
- final File movieFile = new File(file_s1);
- streamLoc0 = Uri.valueOf(movieFile);
- } else if( null != file_s2 ) {
- streamLoc0 = Uri.valueOf(new File(file_s2));
- } else {
+ streamLoc0 = Uri.tryUriOrFile( urls_s[0] );
+ }
+ if( null == streamLoc0 ) {
streamLoc0 = defURI;
}
System.err.println("url_s "+urls_s[0]);
- System.err.println("file_s 1: "+file_s1+", 2: "+file_s2);
System.err.println("stream0 "+streamLoc0);
System.err.println("vid "+vid+", aid "+aid);
System.err.println("textureCount "+textureCount);
@@ -806,13 +790,14 @@ public class MovieSimple implements GLEventListener {
windows[i].setSize(width, height);
windows[i].setVisible(true);
- final Uri streamLocN;
+ Uri streamLocN = null;
if( 0 == i ) {
streamLocN = streamLoc0;
} else {
if( null != urls_s[i] ) {
- streamLocN = Uri.cast(urls_s[i]);
- } else {
+ streamLocN = Uri.tryUriOrFile( urls_s[i] );
+ }
+ if( null == streamLocN ) {
streamLocN = defURI;
}
}