aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl')
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java22
-rw-r--r--src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java7
2 files changed, 25 insertions, 4 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();
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 3520ddf0a..106a374bf 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -350,12 +350,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
public final int getPresentedFrameCount() { return presentedFrameCount; }
@Override
- public final int getVideoPTS() { return video_pts_last.getLast(); }
+ public final PTS getPTS() { return av_scr; }
+
+ @Override
+ public final int getVideoPTS() { return video_pts_last.get(Clock.currentMillis()); }
@Override
public final int getAudioPTS() {
if( State.Uninitialized != state && null != audioSink ) {
- return audioSink.getPTS().getLast();
+ return audioSink.getPTS().get(Clock.currentMillis());
}
return 0;
}