From 14d2d6865ebcfd8f4c1bdb1600f29fc2b1a4366d Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 31 Aug 2013 16:40:44 +0200 Subject: GLMediaPlayer: pause() -> pause(boolean flush): Allowing to flush buffers, next frame after play() will provide new frame. Added API doc. --- .../com/jogamp/opengl/util/av/GLMediaPlayer.java | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/jogl/classes/com') diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java index 5072c410d..63fc693ca 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java @@ -85,7 +85,7 @@ import com.jogamp.opengl.util.TimeFrameI; * {@link #initStream(URI, int, int, int)} {@link State#Uninitialized Uninitialized} {@link State#Initialized Initialized}1, {@link State#Uninitialized Uninitialized} {@link GLMediaEventListener#EVENT_CHANGE_INIT EVENT_CHANGE_INIT} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} ) * {@link #initGL(GL)} {@link State#Initialized Initialized} {@link State#Paused Paused}, , {@link State#Uninitialized Uninitialized} {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} ) * {@link #play()} {@link State#Paused Paused} {@link State#Playing Playing} {@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY} - * {@link #pause()} {@link State#Playing Playing} {@link State#Paused Paused} {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} + * {@link #pause(boolean)} {@link State#Playing Playing} {@link State#Paused Paused} {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} * {@link #seek(int)} {@link State#Paused Paused}, {@link State#Playing Playing} {@link State#Paused Paused}, {@link State#Playing Playing} none * {@link #getNextTexture(GL)} {@link State#Paused Paused}, {@link State#Playing Playing} {@link State#Paused Paused}, {@link State#Playing Playing} none * {@link #getLastTexture()} {@link State#Paused Paused}, {@link State#Playing Playing} {@link State#Paused Paused}, {@link State#Playing Playing} none @@ -427,18 +427,34 @@ public interface GLMediaPlayer extends TextureSequence { public float getAudioVolume(); /** + * Starts or resumes the StreamWorker decoding thread. + *

* Lifecycle: {@link State#Paused} -> {@link State#Playing} + *

*/ public State play(); /** + * Pauses the StreamWorker decoding thread. + *

* Lifecycle: {@link State#Playing} -> {@link State#Paused} + *

+ *

+ * If a new frame is desired after the next {@link #play()} call, + * e.g. to make a snapshot of a camera input stream, + * flush shall be set to true. + *

+ * @param flush if true flushes the video and audio buffers, otherwise keep them intact. */ - public State pause(); + public State pause(boolean flush); /** + * Seeks to the new absolute position. The StreamWorker decoding thread + * is paused while doing so and the A/V buffers are flushed. + *

* Allowed in state {@link State#Playing} and {@link State#Paused}, otherwise ignored, - * see Lifecycle. + * see Lifecycle. + *

* * @param msec absolute desired time position in milliseconds * @return time current position in milliseconds, after seeking to the desired position -- cgit v1.2.3