aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-03-13 05:59:34 +0100
committerSven Gothel <[email protected]>2023-03-13 05:59:34 +0100
commit913b00f8b876e29af91677ef61b3eb35d6853e6e (patch)
tree17bc28ad255f1e086b2aa80028d4e6fb1ffd0456 /src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
parent5efd3a6d9cf12d38ce6d7c91f9c5968927f3253a (diff)
GLMediaPlayer: Overhaul and simplify states, allow usage before stream ready showing test-texture. Adding stop(); (API Change)
- allow multiple initGL(..) @ uninitialized and initialized - allows usage before stream is ready - using a test-texture @ uninitialized - adding stop() API change - initStream() -> playStream() - play() -> resume() FFMPEG: Added 'ready' check for robustness
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java')
-rw-r--r--src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 09d2dfda0..06eca7128 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -136,7 +136,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
@Override
- protected final boolean playImpl() {
+ protected final boolean resumeImpl() {
playStart = Platform.currentTimeMillis();
if(null != mp) {
try {
@@ -212,7 +212,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
protected final int getAudioPTSImpl() { return null != mp ? mp.getCurrentPosition() : 0; }
@Override
- protected final void destroyImpl(final GL gl) {
+ protected final void destroyImpl() {
if(null != mp) {
wakeUp(false);
try {
@@ -239,12 +239,18 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
}
}
+ @Override
+ protected void stopImpl() {
+ destroyImpl();
+ }
+
public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {
public SurfaceTextureFrame(final Texture t, final SurfaceTexture stex) {
super(t);
this.surfaceTex = stex;
}
+ @Override
public String toString() {
return "SurfaceTextureFrame[pts " + pts + " ms, l " + duration + " ms, texID "+ texture.getTextureObject() + ", " + surfaceTex + "]";
}