summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-11-28 13:43:32 +0100
committerSven Gothel <[email protected]>2013-11-28 13:43:32 +0100
commiteb9225c928b9a1a5660c865921fcd91f85cd1cd0 (patch)
treee76a310033c237bc94b50bc908955da99ee17c01 /src/test
parent65247a8188c7470ee7f599f2e84cae1bc84fff9c (diff)
Fix Bug 902: FFMPEGMediaPlayer uses IOUtil.decodeURIIfFilePath(uri) to decode proper file-scheme if applicable - otherwise encoded ASCII URI.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java17
-rw-r--r--src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java23
2 files changed, 32 insertions, 8 deletions
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index a7636fce4..8f27e19c4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -39,6 +40,7 @@ import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import javax.media.opengl.GLProfile;
+import com.jogamp.common.util.IOUtil;
import com.jogamp.newt.Window;
import com.jogamp.newt.event.KeyAdapter;
import com.jogamp.newt.event.KeyEvent;
@@ -327,7 +329,7 @@ public class MovieCube implements GLEventListener {
int aid = GLMediaPlayer.STREAM_ID_AUTO;
final boolean origSize;
- String url_s=null;
+ String url_s=null, file_s=null;
{
boolean _origSize = false;
for(int i=0; i<args.length; i++) {
@@ -351,6 +353,9 @@ 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")) {
@@ -369,11 +374,15 @@ public class MovieCube implements GLEventListener {
origSize = _origSize;
}
final URI streamLoc;
- if( null == url_s ) {
- streamLoc = defURI;
- } else {
+ if( null != url_s ) {
streamLoc = new URI(url_s);
+ } else if( null != file_s ) {
+ streamLoc = IOUtil.toURISimple(new File(file_s));
+ } else {
+ 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/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 897079ec2..1a9914bb7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -28,6 +28,7 @@
package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
@@ -45,6 +46,7 @@ import javax.media.opengl.GLUniformData;
import javax.media.opengl.fixedfunc.GLMatrixFunc;
import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.IOUtil;
import com.jogamp.newt.Window;
import com.jogamp.newt.event.KeyAdapter;
import com.jogamp.newt.event.KeyEvent;
@@ -704,7 +706,7 @@ public class MovieSimple implements GLEventListener {
int aid = GLMediaPlayer.STREAM_ID_AUTO;
final boolean origSize;
- String url_s=null;
+ String url_s=null, file_s1=null, file_s2=null;
{
boolean _origSize = false;
for(int i=0; i<args.length; i++) {
@@ -743,6 +745,12 @@ public class MovieSimple implements GLEventListener {
} else if(args[i].equals("-url")) {
i++;
url_s = args[i];
+ } else if(args[i].equals("-file1")) {
+ i++;
+ file_s1 = args[i];
+ } else if(args[i].equals("-file2")) {
+ i++;
+ file_s2 = args[i];
} else if(args[i].equals("-wait")) {
waitForKey = true;
}
@@ -750,11 +758,18 @@ public class MovieSimple implements GLEventListener {
origSize = _origSize;
}
final URI streamLoc;
- if( null == url_s ) {
- streamLoc = defURI;
- } else {
+ if( null != url_s ) {
streamLoc = new URI(url_s);
+ } else if( null != file_s1 ) {
+ File movieFile = new File(file_s1);
+ streamLoc = movieFile.toURI();
+ } else if( null != file_s2 ) {
+ streamLoc = IOUtil.toURISimple(new File(file_s2));
+ } else {
+ streamLoc = defURI;
}
+ System.err.println("url_s "+url_s);
+ System.err.println("file_s 1: "+file_s1+", 2: "+file_s2);
System.err.println("stream "+streamLoc);
System.err.println("vid "+vid+", aid "+aid);
System.err.println("textureCount "+textureCount);