From 913b00f8b876e29af91677ef61b3eb35d6853e6e Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * Audio and video streams can be selected or muted via {@link #initStream(Uri, int, int, int)} + * Audio and video streams can be selected or muted via {@link #playStream(Uri, int, int, int)} * using the appropriate stream id's. *
*@@ -56,7 +57,7 @@ import com.jogamp.opengl.util.TimeFrameI; *
* Most of the stream processing is performed on the decoding thread, a.k.a. StreamWorker: *
*
Action | {@link State} Before | {@link State} After | {@link GLMediaEventListener Event} |
---|---|---|---|
{@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 #playStream(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#Uninitialized Uninitialized} | {@link State#Playing Playing}, {@link State#Uninitialized Uninitialized} | {@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY} or ( {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} ) |
{@link #pause(boolean)} | {@link State#Playing Playing} | {@link State#Paused Paused} | {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} |
{@link #resume()} | {@link State#Paused Paused} | {@link State#Playing Playing} | {@link GLMediaEventListener#EVENT_CHANGE_PLAY EVENT_CHANGE_PLAY} |
{@link #stop()} | {@link State#Playing Playing}, {@link State#Paused Paused} | {@link State#Uninitialized Uninitialized} | {@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 |
{@link #getNextTexture(GL)} | any | same | none |
{@link #getLastTexture()} | any | same | none |
{@link TextureFrame#END_OF_STREAM_PTS END_OF_STREAM} | {@link State#Playing Playing} | {@link State#Paused Paused} | {@link GLMediaEventListener#EVENT_CHANGE_EOS EVENT_CHANGE_EOS} + {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} |
{@link StreamException} | ANY | {@link State#Paused Paused}, {@link State#Uninitialized Uninitialized} | {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + ( {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} ) |
{@link #destroy(GL)} | ANY | {@link State#Uninitialized Uninitialized} | {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} |
{@link StreamException} | any | {@link State#Paused Paused}, {@link State#Uninitialized Uninitialized} | {@link GLMediaEventListener#EVENT_CHANGE_ERR EVENT_CHANGE_ERR} + ( {@link GLMediaEventListener#EVENT_CHANGE_PAUSE EVENT_CHANGE_PAUSE} or {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} ) |
{@link #destroy(GL)} | any | {@link State#Uninitialized Uninitialized} | {@link GLMediaEventListener#EVENT_CHANGE_UNINIT EVENT_CHANGE_UNINIT} |
null
if none occured.
@@ -389,7 +392,7 @@ public interface GLMediaPlayer extends TextureSequence {
* * Lifecycle: {@link State#Initialized} -> {@link State#Paused} or {@link State#Initialized} *
- * Argumentgl
is ignored if video is muted, see {@link #initStream(Uri, int, int, int)}.
+ * Argument gl
is ignored if video is muted, see {@link #playStream(Uri, int, int, int)}.
*
* @param gl current GL object. Maybe null
, for audio only.
* @throws IllegalStateException if not invoked in {@link State#Initialized}.
@@ -401,7 +404,7 @@ public interface GLMediaPlayer extends TextureSequence {
/**
* If implementation uses a {@link AudioSink}, it's instance will be returned.
* - * The {@link AudioSink} instance is available after {@link #initStream(Uri, int, int, int)}, + * The {@link AudioSink} instance is available after {@link #playStream(Uri, int, int, int)}, * if used by implementation. *
*/ @@ -415,6 +418,14 @@ public interface GLMediaPlayer extends TextureSequence { */ public State destroy(GL gl); + /** + * Stops streaming and releases the GL, stream and other resources, but keeps {@link #attachObject(String, Object) attached user objects}. + *
+ * Lifecycle: ANY
-> {@link State#Uninitialized}
+ *
@@ -452,7 +463,7 @@ public interface GLMediaPlayer extends TextureSequence { * Lifecycle: {@link State#Paused} -> {@link State#Playing} *
*/ - public State play(); + public State resume(); /** * Pauses the StreamWorker decoding thread. @@ -460,7 +471,7 @@ public interface GLMediaPlayer extends TextureSequence { * Lifecycle: {@link State#Playing} -> {@link State#Paused} * *
- * If a new frame is desired after the next {@link #play()} call,
+ * If a new frame is desired after the next {@link #resume()} call,
* e.g. to make a snapshot of a camera input stream,
* flush
shall be set to true
.
*