aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/com/jogamp/opengl/util
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-16 04:03:24 +0200
committerSven Gothel <[email protected]>2023-10-16 04:03:24 +0200
commitee29eaf770d0d3627e5989dcae58a87cf27184d3 (patch)
tree60a9841ddb9a92878b7b6c1f6a52e39ada89c0e5 /src/jogl/classes/com/jogamp/opengl/util
parent76cf00ea0a157b33af9b2ffa608ded992f8c0ff2 (diff)
Bug 1472: GLMediaPlayer: Expose SCR PTS and encourage its usage, removes user from selecting video or audio PTS.
Diffstat (limited to 'src/jogl/classes/com/jogamp/opengl/util')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java22
1 files changed, 20 insertions, 2 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 e3ef27303..740d0fda8 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -37,8 +37,10 @@ import java.util.List;
import com.jogamp.common.av.AudioFormat;
import com.jogamp.common.av.AudioSink;
+import com.jogamp.common.av.PTS;
import com.jogamp.common.av.TimeFrameI;
import com.jogamp.common.net.Uri;
+import com.jogamp.common.os.Clock;
import com.jogamp.opengl.util.texture.Texture;
import com.jogamp.opengl.util.texture.TextureSequence;
@@ -612,23 +614,39 @@ public interface GLMediaPlayer extends TextureSequence {
*/
public int getPresentedFrameCount();
+
+ /**
+ * Returns current System Clock Reference (SCR) presentation timestamp ({@link PTS}).
+ * <p>
+ * To retrieve the current interpolated PTS against the stored System Clock Reference (SCR), use:
+ * <pre>
+ * int pts = mPlayer.getPTS().get(Clock.currentMillis());
+ * </pre>
+ * </p>
+ **/
+ public PTS getPTS();
+
/**
- * Returns current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()}
+ * Returns current video presentation timestamp (PTS) in milliseconds of {@link #getLastTexture()},
+ * try using {@link #getPTS()}.
* <p>
* The relative millisecond PTS since start of the presentation stored in integer
* covers a time span of 2'147'483'647 ms (see {@link Integer#MAX_VALUE}
* or 2'147'483 seconds or 24.855 days.
* </p>
+ * @see #getPTS()
**/
public int getVideoPTS();
/**
- * Returns current audio presentation timestamp (PTS) in milliseconds.
+ * Returns current audio presentation timestamp (PTS) in milliseconds,
+ * try using {@link #getPTS()}.
* <p>
* The relative millisecond PTS since start of the presentation stored in integer
* covers a time span of 2'147'483'647 ms (see {@link Integer#MAX_VALUE}
* or 2'147'483 seconds or 24.855 days.
* </p>
+ * @see #getPTS()
**/
public int getAudioPTS();