summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-04-09 04:49:41 +0200
committerSven Gothel <[email protected]>2012-04-09 04:49:41 +0200
commit3a26aa701b4a1a0991cd997a0d295a1b83cd12f3 (patch)
tree0bbf0c79127ab8329220e2766177c3073244277b /src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java
parent1e61021a062b1403f7eed948ac9d2ea0c04ea951 (diff)
GLMediaPlayer*: Revised - Working on buggy MediaPlayer impl. (Android ICS Tegra)
GLMediaPlayer: Merging 'initStream()' and 'initGL()' to 'initGLStream()' due to incompatible/buggy implementations (Android/Tegra) requiring the GL texture being setup before preparing the stream. This also implies that w/o an GL context we cannot fetch the stream information (size, ..) hence we need to evaluate this detail (FIXME). 'getNextTexture(GL gl, boolean blocking)' can request the impl. to block GLMediaEventListener: The TextureFrame not yet available, adding 'when'
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java
index c7eb2722c..a5d41bc9c 100644
--- a/src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/av/NullGLMediaPlayer.java
@@ -32,7 +32,6 @@ import java.net.URLConnection;
import java.nio.ByteBuffer;
import javax.media.opengl.GL;
-import javax.media.opengl.GLContext;
import javax.media.opengl.GLProfile;
import jogamp.opengl.av.GLMediaPlayerImpl;
@@ -40,6 +39,7 @@ import jogamp.opengl.av.GLMediaPlayerImpl;
import com.jogamp.common.nio.Buffers;
import com.jogamp.common.util.IOUtil;
import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
import com.jogamp.opengl.util.texture.TextureData;
import com.jogamp.opengl.util.texture.TextureIO;
@@ -96,11 +96,16 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- public TextureFrame getNextTexture() {
+ public TextureFrame getNextTexture(GL gl, boolean blocking) {
return frame;
}
@Override
+ public TextureCoords getTextureCoords() {
+ return frame.getTexture().getImageTexCoords();
+ }
+
+ @Override
public long getCurrentPosition() {
pos_ms = System.currentTimeMillis() - pos_start;
validatePos();
@@ -112,7 +117,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected void initStreamImplPreGL() throws IOException {
+ protected void initGLStreamImpl(GL gl, int[] texNames) throws IOException {
try {
URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-160x90.png", NullGLMediaPlayer.class.getClassLoader());
if(null != urlConn) {
@@ -146,15 +151,15 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
}
@Override
- protected void destroyTexImage(GLContext ctx, TextureFrame imgTex) {
- super.destroyTexImage(ctx, imgTex);
+ protected void destroyTexImage(GL gl, TextureFrame imgTex) {
+ super.destroyTexImage(gl, imgTex);
}
@Override
- protected TextureFrame createTexImage(GLContext ctx, int idx, int[] tex) {
- Texture texture = super.createTexImageImpl(ctx, idx, tex, false);
+ protected TextureFrame createTexImage(GL gl, int idx, int[] tex) {
+ Texture texture = super.createTexImageImpl(gl, idx, tex, false);
if(null != texData) {
- texture.updateImage(ctx.getGL(), texData);
+ texture.updateImage(gl, texData);
}
frame = new TextureFrame( texture );
return frame;