From dbd0236203f3d969575e62097f42a2a86e2a36ae Mon Sep 17 00:00:00 2001
From: Sven Gothel
- * avgFrameDuration = {@link #getQueuedTime()} / {@link #getQueuedFrameCount()} + * avgFrameDuration = {@link #getQueuedDuration()} / {@link #getQueuedFrameCount()} **/ public float getAvgFrameDuration(); @@ -446,4 +446,16 @@ public interface AudioSink { * @see #init(AudioFormat, float, int) */ public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount); + + /** + * Update queue beyond {@link #enqueueData(int, ByteBuffer, int)} including audio PTS. + *
+ * Useful in case implementation only updates the buffer passively via {@link #enqueueData(int, ByteBuffer, int) enqueueing data} + * to add new data to the queue and not on a event basis. + *
+ * @return the updated current audio PTS + * @see #getPTS() + * @see #enqueueData(int, ByteBuffer, int) + */ + public int updateQueue(); } diff --git a/src/java/jogamp/common/av/JavaSoundAudioSink.java b/src/java/jogamp/common/av/JavaSoundAudioSink.java index 94ad236..556ada4 100644 --- a/src/java/jogamp/common/av/JavaSoundAudioSink.java +++ b/src/java/jogamp/common/av/JavaSoundAudioSink.java @@ -305,7 +305,7 @@ public final class JavaSoundAudioSink implements AudioSink { } @Override - public float getQueuedTime() { + public float getQueuedDuration() { return chosenFormat.getBytesDuration( getQueuedByteCount() ); } @@ -317,6 +317,9 @@ public final class JavaSoundAudioSink implements AudioSink { @Override public final int getPTS() { return 0; } // FIXME + @Override + public final int updateQueue() { return 0; } // FIXME + @Override public int getLastBufferedPTS() { return 0; } // FIXME diff --git a/src/java/jogamp/common/av/NullAudioSink.java b/src/java/jogamp/common/av/NullAudioSink.java index 0626ca8..d38c040 100644 --- a/src/java/jogamp/common/av/NullAudioSink.java +++ b/src/java/jogamp/common/av/NullAudioSink.java @@ -174,7 +174,7 @@ public final class NullAudioSink implements AudioSink { public int getQueuedByteCount() { return 0; } @Override - public float getQueuedTime() { return 0f; } + public float getQueuedDuration() { return 0f; } @Override public float getAvgFrameDuration() { return 0f; } @@ -182,6 +182,9 @@ public final class NullAudioSink implements AudioSink { @Override public final int getPTS() { return playingPTS; } + @Override + public final int updateQueue() { return playingPTS; } + @Override public int getLastBufferedPTS() { return 0; } -- cgit v1.2.3