aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/jogamp/common
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-05-21 13:05:29 +0200
committerSven Gothel <[email protected]>2023-05-21 13:05:29 +0200
commit5c33470aea6b30c81681992567d7c92e100bdab3 (patch)
tree1025a24ff9a786b2128fcc976d5d9a0257ffb181 /src/java/jogamp/common
parent325e5ed234a5e15f8f94eaa72dba6dbb619d490a (diff)
AudioSink: Add getAvgFrameDuration(); API-Doc: Default*: 'frame' -> AudioFrame; init(): Use getAvgFrameDuration() for queue growth and limit.
This change renders buffer dequeueing, growth and limit sticking w/ [ms] values while getAvgFrameDuration() assists frame count determination. getAvgFrameDuration() is calculated when buffer is fully filled (queuedBytes / queuedFrames), i.e. a proper representation to be used to dequeue in duration range as well as for growth. This further decouples the frameDuration{->Hint} parameter in init(), as it is now only used for the initial buffer count (and latency adjustment).
Diffstat (limited to 'src/java/jogamp/common')
-rw-r--r--src/java/jogamp/common/av/JavaSoundAudioSink.java5
-rw-r--r--src/java/jogamp/common/av/NullAudioSink.java5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/java/jogamp/common/av/JavaSoundAudioSink.java b/src/java/jogamp/common/av/JavaSoundAudioSink.java
index 1617b10..bdf4e22 100644
--- a/src/java/jogamp/common/av/JavaSoundAudioSink.java
+++ b/src/java/jogamp/common/av/JavaSoundAudioSink.java
@@ -285,6 +285,11 @@ public class JavaSoundAudioSink implements AudioSink {
}
@Override
+ public int getAvgFrameDuration() {
+ return 0;
+ }
+
+ @Override
public final int getPTS() { return 0; } // FIXME
}
diff --git a/src/java/jogamp/common/av/NullAudioSink.java b/src/java/jogamp/common/av/NullAudioSink.java
index 781cfca..58f4b0d 100644
--- a/src/java/jogamp/common/av/NullAudioSink.java
+++ b/src/java/jogamp/common/av/NullAudioSink.java
@@ -190,6 +190,11 @@ public class NullAudioSink implements AudioSink {
}
@Override
+ public int getAvgFrameDuration() {
+ return 0;
+ }
+
+ @Override
public final int getPTS() { return playingPTS; }
@Override