summaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/android
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-04-11 19:46:37 +0200
committerSven Gothel <[email protected]>2012-04-11 19:46:37 +0200
commitf10b30c16aeec428378d1d560d030b2d39801c4e (patch)
tree869ca02373385659ed356d781a602fdc2d7d1666 /src/jogl/classes/jogamp/opengl/android
parent41b75429e3801f8bf8d5eea679487ccc49ce2584 (diff)
Refine GLMediaPlayer/TextureSequence, add MovieCube demo, fix minor bug in Texture
- Add TextureSequence, base interface of GLMediaPlayer to genralize texture streams - TextureSequence / GLMediaPlayer: Use inner classes for event and texture data - getLastTexture() shall never return 'null', initialization of TextureSequence (initGLStream(..), etc) shall provide a TextureFrame w/ the stream's dimension. - GLMediaPlayerImpl.createTexImageImpl() y-flip defaults to 'false' impl. shall define y-flip, if required. - Added MovieCube demo - Fix Texture: initialize aspectRation for 'wrapping' ctor -
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/android')
-rw-r--r--src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index ae45662db..a50f1507f 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -32,10 +32,10 @@ import java.io.IOException;
import javax.media.opengl.GL;
import javax.media.opengl.GLES2;
-import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
import jogamp.common.os.android.StaticContext;
-import jogamp.opengl.av.GLMediaPlayerImpl;
+import jogamp.opengl.util.av.GLMediaPlayerImpl;
import android.graphics.SurfaceTexture;
import android.graphics.SurfaceTexture.OnFrameAvailableListener;
@@ -51,7 +51,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
MediaPlayer mp;
volatile boolean updateSurface = false;
Object updateSurfaceLock = new Object();
- TextureFrame lastTexFrame = null;
+ TextureSequence.TextureFrame lastTexFrame = null;
/**
private static String toString(MediaPlayer m) {
@@ -133,12 +133,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
@Override
- public TextureFrame getLastTexture() {
+ public TextureSequence.TextureFrame getLastTexture() {
return lastTexFrame;
}
@Override
- public TextureFrame getNextTexture(GL gl, boolean blocking) {
+ public TextureSequence.TextureFrame getNextTexture(GL gl, boolean blocking) {
if(null != stex && null != mp) {
// Only block once, no while-loop.
// This relaxes locking code of non crucial resources/events.
@@ -166,11 +166,6 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
return lastTexFrame;
}
- @Override
- public TextureCoords getTextureCoords() {
- return texFrames[0].getTexture().getImageTexCoords();
- }
-
private void wakeUp(boolean newFrame) {
synchronized(updateSurfaceLock) {
if(newFrame) {
@@ -226,12 +221,19 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
totalFrames = 0;
duration = mp.getDuration();
acodec = "unknown";
- vcodec = "unknown";
+ vcodec = "unknown";
}
}
@Override
- protected void destroyTexImage(GL gl, TextureFrame imgTex) {
+ protected TextureSequence.TextureFrame createTexImage(GL gl, int idx, int[] tex) {
+ lastTexFrame = new TextureSequence.TextureFrame( createTexImageImpl(gl, idx, tex, true) );
+ // lastTexFrame = super.createTexImage(gl, idx, tex);
+ return lastTexFrame;
+ }
+
+ @Override
+ protected void destroyTexImage(GL gl, TextureSequence.TextureFrame imgTex) {
if(null != stex) {
stex.release();
stex = null;