diff options
author | Sven Göthel <[email protected]> | 2024-01-31 11:28:10 +0100 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-01-31 11:28:10 +0100 |
commit | b8b692e9cf3120d788ae912514f54948ddccacf5 (patch) | |
tree | aafde7897934d548789297efc20336754af06624 /src/jogl/classes/com/jogamp/opengl/util | |
parent | 72065d9e2a9d6480c34afc9920071d5ed577d37a (diff) |
GLMediaPlayer: Split GLMediaFrameListener (rarely used) from GLMediaEventListener, easing listener callbacks; Prepare SubtitleEventListener generalization (Bug 1494)
Moves pushSound(), pushSubtitle*() from FFMPEGMediaPlayer to GLMediaPlayerImpl,
as it is handled in a generic way - even though currently only called by native FFMPEGMediaPlayer implementation.
Note: This patch is incomplete, i.e. not even compile clean.
But choses as-is to semantically split the work to ease review.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r-- | src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java | 39 |
1 files changed, 29 insertions, 10 deletions
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 91211df58..987031b6b 100644 --- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java +++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java @@ -291,17 +291,14 @@ public interface GLMediaPlayer extends TextureSequence { } /** - * {@inheritDoc} - * <p> - * As the contract of {@link TexSeqEventListener} requests, - * implementations of {@link GLMediaEventListener} shall also: + * As the contract of {@link GLMediaFrameListener} and {@link TexSeqEventListener} requests, + * implementations of {@link GLMediaEventListener} shall: * <ul> * <li>off-load complex or {@link GLMediaPlayer} commands on another thread, or</li> * <li>simply changing a volatile state of their {@link GLEventListener} implementation.</li> * </ul> - * </p> */ - public interface GLMediaEventListener extends TexSeqEventListener<GLMediaPlayer> { + public interface GLMediaEventListener { /** * @param mp the event source * @param event_mask the changes attributes @@ -309,6 +306,19 @@ public interface GLMediaPlayer extends TextureSequence { */ public void attributesChanged(GLMediaPlayer mp, EventMask event_mask, long when); } + /** + * {@inheritDoc} + * <p> + * As the contract of {@link TexSeqEventListener} requests, + * implementations of {@link GLMediaEventListener} shall also: + * <ul> + * <li>off-load complex or {@link GLMediaPlayer} commands on another thread, or</li> + * <li>simply changing a volatile state of their {@link GLEventListener} implementation.</li> + * </ul> + * </p> + */ + public interface GLMediaFrameListener extends TexSeqEventListener<GLMediaPlayer> { + } /** Changes attributes event mask */ public static final class EventMask { @@ -905,10 +915,19 @@ public interface GLMediaPlayer extends TextureSequence { /** Return all {@link GLMediaEventListener} of this player. */ public GLMediaEventListener[] getEventListeners(); - /** Sets the {@link ASSEventListener} for this player. */ - public void setASSEventListener(ASSEventListener l); - /** Returns the {@link #setASSEventListener(ASSEventListener)} of this player. */ - public ASSEventListener getASSEventListener(); + /** Adds a {@link GLMediaFrameListener} to this player. */ + public void addFrameListener(GLMediaFrameListener l); + + /** Removes a {@link GLMediaFrameListener} to this player. */ + public void removeFrameListener(GLMediaFrameListener l); + + /** Return all {@link GLMediaFrameListener} of this player. */ + public GLMediaFrameListener[] getFrameListeners(); + + /** Sets the {@link SubtitleEventListener} for this player. */ + public void setSubtitleEventListener(SubtitleEventListener l); + /** Returns the {@link #setSubtitleEventListener(SubtitleEventListener)} of this player. */ + public SubtitleEventListener getSubtitleEventListener(); /** * Returns the attached user object for the given name. |