summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/omx
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-04-05 03:22:04 +0200
committerSven Gothel <[email protected]>2012-04-05 03:22:04 +0200
commit9d1ee2b69fc943559a17dcd5d59984f8bba15296 (patch)
tree8402f40f500a18f26e8e7580e0a2185c35c02726 /src/jogl/classes/jogamp/opengl/omx
parenta4c8271adc1932903a34e34bee24ff274ed1a81e (diff)
GLMediaPlayer: Use URLConnection to clarify emphasize passing an available connected URL. API doc: Useing html table for state chart
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/omx')
-rw-r--r--src/jogl/classes/jogamp/opengl/omx/OMXGLMediaPlayer.java26
1 files changed, 5 insertions, 21 deletions
diff --git a/src/jogl/classes/jogamp/opengl/omx/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/omx/OMXGLMediaPlayer.java
index 1005abd80..99639ae62 100644
--- a/src/jogl/classes/jogamp/opengl/omx/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/omx/OMXGLMediaPlayer.java
@@ -1,16 +1,14 @@
package jogamp.opengl.omx;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.io.IOException;
+import java.net.URL;
import javax.media.opengl.GL;
import javax.media.opengl.GLContext;
import javax.media.opengl.GLException;
import com.jogamp.opengl.av.GLMediaEventListener;
-import com.jogamp.opengl.av.GLMediaPlayer.TextureFrame;
import jogamp.opengl.av.EGLMediaPlayerImpl;
import jogamp.opengl.egl.EGL;
@@ -69,25 +67,11 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
if(0==moviePtr) {
throw new GLException("OMX native instance null");
}
- String path=null;
- if (url.getProtocol() == null || "file".equals(url.getProtocol())) {
- // CV only accepts absolute paths
- try {
- File file = new File(url.getPath());
- if (!file.exists()) {
- throw new FileNotFoundException(file.toString());
- }
- path = file.getCanonicalPath();
- System.out.println("setURL: path "+path);
- } catch (Exception e) {
- e.printStackTrace();
- throw new IOException(e);
- }
- }
- path = replaceAll(path, "\\", "/").trim();
- if(null==path) {
- throw new IOException("Couldn't parse stream URL: "+url);
+ final URL url = urlConn.getURL();
+ if(!url.getProtocol().equals("file")) {
+ throw new IOException("Only file URLs are allowed: "+url);
}
+ final String path=url.getPath();
System.out.println("setURL: clean path "+path);
System.out.println("setURL: p1 "+this);