summaryrefslogtreecommitdiffstats
path: root/dom/media/driftcontrol/AudioResampler.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/media/driftcontrol/AudioResampler.h
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz
firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/driftcontrol/AudioResampler.h')
-rw-r--r--dom/media/driftcontrol/AudioResampler.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/dom/media/driftcontrol/AudioResampler.h b/dom/media/driftcontrol/AudioResampler.h
index 20e4f1051b..c5982c3a39 100644
--- a/dom/media/driftcontrol/AudioResampler.h
+++ b/dom/media/driftcontrol/AudioResampler.h
@@ -9,12 +9,11 @@
#include "AudioChunkList.h"
#include "AudioSegment.h"
#include "DynamicResampler.h"
-#include "TimeUnits.h"
namespace mozilla {
/**
- * Audio Resampler is a resampler able to change the output rate and channels
+ * Audio Resampler is a resampler able to change the input rate and channels
* count on the fly. The API is simple and it is based in AudioSegment in order
* to be used MTG. Memory allocations, for input and output buffers, will happen
* in the constructor, when channel count changes and if the amount of input
@@ -36,7 +35,7 @@ namespace mozilla {
class AudioResampler final {
public:
AudioResampler(uint32_t aInRate, uint32_t aOutRate,
- media::TimeUnit aPreBufferDuration,
+ uint32_t aInputPreBufferFrameCount,
const PrincipalHandle& aPrincipalHandle);
/**
@@ -69,24 +68,24 @@ class AudioResampler final {
AudioSegment Resample(uint32_t aOutFrames, bool* aHasUnderrun);
/*
- * Updates the output rate that will be used by the resampler.
+ * Updates the input rate that will be used by the resampler.
*/
- void UpdateOutRate(uint32_t aOutRate) {
- Update(aOutRate, mResampler.GetChannels());
+ void UpdateInRate(uint32_t aInRate) {
+ Update(aInRate, mResampler.GetChannels());
}
/**
- * Set the duration that should be used for pre-buffering.
+ * Set the number of frames that should be used for input pre-buffering.
*/
- void SetPreBufferDuration(media::TimeUnit aPreBufferDuration) {
- mResampler.SetPreBufferDuration(aPreBufferDuration);
+ void SetInputPreBufferFrameCount(uint32_t aInputPreBufferFrameCount) {
+ mResampler.SetInputPreBufferFrameCount(aInputPreBufferFrameCount);
}
private:
void UpdateChannels(uint32_t aChannels) {
- Update(mResampler.GetOutRate(), aChannels);
+ Update(mResampler.GetInRate(), aChannels);
}
- void Update(uint32_t aOutRate, uint32_t aChannels);
+ void Update(uint32_t aInRate, uint32_t aChannels);
private:
DynamicResampler mResampler;