From c67de337a8aaf52e36104c3f13e273aa19d21f1f Mon Sep 17 00:00:00 2001
From: Sven Gothel
Date: Sat, 22 Feb 2014 08:05:42 +0100
Subject: Bug 927 - Multithreading (MT) - GLMediaPlayer.GLMediaEventListener:
Remind that commands shall be off-loaded on another thread!
---
.../classes/com/jogamp/opengl/util/av/GLMediaPlayer.java | 8 +++++++-
.../com/jogamp/opengl/util/texture/TextureSequence.java | 12 ++++++------
2 files changed, 13 insertions(+), 7 deletions(-)
(limited to 'src/jogl/classes/com/jogamp/opengl')
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 9957f2093..5a455c8bd 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl.util.av;
import java.net.URI;
import javax.media.opengl.GL;
+import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLException;
import jogamp.opengl.Debug;
@@ -255,7 +256,12 @@ public interface GLMediaPlayer extends TextureSequence {
/**
* {@inheritDoc}
*
- * See {@link TexSeqEventListener} for semantics and usage.
+ * As the contract of {@link TexSeqEventListener} requests,
+ * implementations of {@link GLMediaEventListener} shall also:
+ *
+ * - off-load complex or {@link GLMediaPlayer} commands on another thread, or
+ * - simply changing a volatile state of their {@link GLEventListener} implementation.
+ *
*
*/
public interface GLMediaEventListener extends TexSeqEventListener {
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 6c2949c2b..ab9d1f8f0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -31,6 +31,7 @@ import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLRunnable;
import javax.media.opengl.GLEventListener;
+
import com.jogamp.opengl.util.TimeFrameI;
/**
@@ -133,17 +134,16 @@ public interface TextureSequence {
/**
* Event listener to notify users of updates regarding the {@link TextureSequence}.
*
- * The implementation sending the events, and hence calling down to all listeners,
- * does not necessarily make the user's OpenGL context current.
+ * Implementations sending events down to all listeners,
+ * while not necessarily making the user's OpenGL context current.
*
*
- * Further more, the call may happen off-thread, possibly holding another, possibly shared, OpenGL context current.
- *
+ * Events may be sent from a 3rd-party thread, possibly holding another, maybe shared, OpenGL context current.
* Hence a user shall not issue any OpenGL, time consuming
- * or {@link TextureSequence} lifecycle operations directly.
+ * or {@link TextureSequence} operations directly.
* Instead, the user shall:
*
- * - issue commands off-thread via spawning off another thread, or
+ * - off-load complex or {@link TextureSequence} commands on another thread, or
* - injecting {@link GLRunnable} objects via {@link GLAutoDrawable#invoke(boolean, GLRunnable)}, or
* - simply changing a volatile state of their {@link GLEventListener} implementation.
*
--
cgit v1.2.3