diff options
author | Sven Gothel <[email protected]> | 2023-05-18 07:39:37 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-05-18 07:39:37 +0200 |
commit | 7905a197ee21e07bb3a6f5ea33fb789c98253af0 (patch) | |
tree | c1aec355a96ded1af933162c4433e66ee8ab246a /src/demos/com | |
parent | 439d8e69a91c5c906dc5813beed85bc88e81f69b (diff) |
MovieCube: Restart @ EOS
Diffstat (limited to 'src/demos/com')
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/av/MovieCube.java | 19 | ||||
-rw-r--r-- | src/demos/com/jogamp/opengl/demos/av/MovieSimple.java | 8 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java index 6fafc6dc7..4cd6b09b6 100644 --- a/src/demos/com/jogamp/opengl/demos/av/MovieCube.java +++ b/src/demos/com/jogamp/opengl/demos/av/MovieCube.java @@ -113,8 +113,8 @@ public class MovieCube implements GLEventListener { @Override public void attributesChanged(final GLMediaPlayer mp, final GLMediaPlayer.EventMask eventMask, final long when) { - System.err.println("MovieCube AttributesChanges: "+eventMask+", when "+when); - System.err.println("MovieCube State: "+mp); + System.err.println("MovieCube.0 AttributesChanges: "+eventMask+", when "+when); + System.err.println("MovieCube.0 State: "+mp); if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Size) ) { resetGLState(); } @@ -603,8 +603,8 @@ public class MovieCube implements GLEventListener { @Override public void attributesChanged(final GLMediaPlayer mp, final GLMediaPlayer.EventMask event_mask, final long when) { - System.err.println("MovieCube AttributesChanges: events_mask "+event_mask+", when "+when); - System.err.println("MovieCube State: "+mp); + System.err.println("MovieCube.1 AttributesChanges: events_mask "+event_mask+", when "+when); + System.err.println("MovieCube.1 State: "+mp); if( event_mask.isSet(GLMediaPlayer.EventMask.Bit.Size) ) { if( origSize ) { window.setSurfaceSize(mp.getWidth(), mp.getHeight()); @@ -619,7 +619,16 @@ public class MovieCube implements GLEventListener { if( event_mask.isSet(GLMediaPlayer.EventMask.Bit.Play) ) { anim.resetFPSCounter(); } - if( event_mask.isSet(GLMediaPlayer.EventMask.Bit.Error) || event_mask.isSet(GLMediaPlayer.EventMask.Bit.EOS) ) { + if( event_mask.isSet(GLMediaPlayer.EventMask.Bit.EOS) ) { + new InterruptSource.Thread() { + @Override + public void run() { + // loop for-ever .. + mc.mPlayer.seek(0); + mc.mPlayer.resume(); + } }.start(); + } + if( event_mask.isSet(GLMediaPlayer.EventMask.Bit.Error) ) { final StreamException se = mc.mPlayer.getStreamException(); if( null != se ) { se.printStackTrace(); diff --git a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java index f851cc4e7..643d4c49f 100644 --- a/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java +++ b/src/demos/com/jogamp/opengl/demos/av/MovieSimple.java @@ -379,8 +379,8 @@ public class MovieSimple implements GLEventListener { @Override public void attributesChanged(final GLMediaPlayer mp, final GLMediaPlayer.EventMask eventMask, final long when) { - System.err.println("MovieSimple AttributesChanges: "+eventMask+", when "+when); - System.err.println("MovieSimple State: "+mp); + System.err.println("MovieSimple.0 AttributesChanges: "+eventMask+", when "+when); + System.err.println("MovieSimple.0 State: "+mp); if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.EOS) ) { new InterruptSource.Thread() { @Override @@ -578,8 +578,8 @@ public class MovieSimple implements GLEventListener { @Override public void attributesChanged(final GLMediaPlayer mp, final GLMediaPlayer.EventMask eventMask, final long when) { - System.err.println("MovieSimple AttributesChanges: "+eventMask+", when "+when); - System.err.println("MovieSimple State: "+mp); + System.err.println("MovieSimple.1 AttributesChanges: "+eventMask+", when "+when); + System.err.println("MovieSimple.1 State: "+mp); final GLWindow window = (GLWindow) mp.getAttachedObject(WINDOW_KEY); final MovieSimple ms = (MovieSimple)mp.getAttachedObject(PLAYER); if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Size) ) { |