From b8b692e9cf3120d788ae912514f54948ddccacf5 Mon Sep 17 00:00:00 2001
From: Sven Göthel
Date: Wed, 31 Jan 2024 11:28:10 +0100
Subject: 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.
---
.../com/jogamp/opengl/util/av/GLMediaPlayer.java | 39 ++++++++++++++++------
1 file changed, 29 insertions(+), 10 deletions(-)
(limited to 'src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java')
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}
- *
- * 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:
*
* - 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 {
+ 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}
+ *
+ * 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 GLMediaFrameListener extends TexSeqEventListener {
+ }
/** 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.
--
cgit v1.2.3