diff options
Diffstat (limited to 'src')
3 files changed, 14 insertions, 0 deletions
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java index ab9d1f8f0..88f40e927 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java +++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java @@ -174,6 +174,12 @@ public interface TextureSequence { public int[] getTextureWrapST(); /** + * Returns true if texture source is ready <i>and</i> a texture is available + * via {@link #getNextTexture(GL)} and {@link #getLastTexture()}. + */ + public boolean isTextureAvailable(); + + /** * Returns the last updated texture. * <p> * In case the instance is just initialized, it shall return a <code>TextureFrame</code> diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java index 6a0e0061f..63bb22d80 100644 --- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java +++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java @@ -737,6 +737,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer { } @Override + public final boolean isTextureAvailable() { + return State.Paused == state || State.Playing == state; + } + + @Override public final TextureFrame getLastTexture() throws IllegalStateException { if( State.Paused != state && State.Playing != state ) { throw new IllegalStateException("Instance not paused or playing: "+this); diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java index b015aebba..7034f2c67 100644 --- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java +++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java @@ -77,6 +77,9 @@ public class TextureSequenceDemo01 implements TextureSequence { } @Override + public boolean isTextureAvailable() { return true; } + + @Override public TextureSequence.TextureFrame getLastTexture() throws IllegalStateException { return frame; // may return null } |