Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(911)

Unified Diff: media/base/audio_converter.h

Issue 2004283002: AudioConverter: Express delay in frames rather than msec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed files & removed rounding Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/audio_buffer_converter.cc ('k') | media/base/audio_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_converter.h
diff --git a/media/base/audio_converter.h b/media/base/audio_converter.h
index 88e003104975dfce72521ed970cdcd1c50a2b9f9..ba6d2a7c18caf2a91ef7adfd52501d35776f744b 100644
--- a/media/base/audio_converter.h
+++ b/media/base/audio_converter.h
@@ -56,8 +56,9 @@ class MEDIA_EXPORT AudioConverter {
// volume level of the provided audio data. If a volume level of zero is
// returned no further processing will be done on the provided data, else
// the volume level will be used to scale the provided audio data.
+ // |frames_delayed| is given in terms of the input sample rate.
virtual double ProvideInput(AudioBus* audio_bus,
- base::TimeDelta buffer_delay) = 0;
+ uint32_t frames_delayed) = 0;
protected:
virtual ~InputCallback() {}
@@ -74,10 +75,11 @@ class MEDIA_EXPORT AudioConverter {
bool disable_fifo);
~AudioConverter();
- // Converts audio from all inputs into the |dest|. If an |initial_delay| is
- // specified, it will be propagated to each input.
+ // Converts audio from all inputs into the |dest|. If |frames_delayed| is
+ // specified, it will be propagated to each input. Count of frames must be
+ // given in terms of the output sample rate.
void Convert(AudioBus* dest);
- void ConvertWithDelay(const base::TimeDelta& initial_delay, AudioBus* dest);
+ void ConvertWithDelay(uint32_t frames_delayed, AudioBus* dest);
// Adds or removes an input from the converter. RemoveInput() will call
// Reset() if no inputs remain after the specified input is removed.
@@ -133,10 +135,9 @@ class MEDIA_EXPORT AudioConverter {
bool downmix_early_;
// Used to calculate buffer delay information for InputCallbacks.
- base::TimeDelta input_frame_duration_;
- base::TimeDelta output_frame_duration_;
- base::TimeDelta initial_delay_;
- int resampler_frame_delay_;
+ uint32_t initial_frames_delayed_;
+ uint32_t resampler_frames_delayed_;
+ const double io_sample_rate_ratio_;
// Number of channels of input audio data. Set during construction via the
// value from the input AudioParameters class. Preserved to recreate internal
« no previous file with comments | « media/base/audio_buffer_converter.cc ('k') | media/base/audio_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698