diff options
author | dalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 22:53:28 +0000 |
---|---|---|
committer | dalecurtis@google.com <dalecurtis@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-08 22:53:28 +0000 |
commit | a70013babca3b661bbc3ef198ad2f58c88ec4078 (patch) | |
tree | 88f54b2897dd67430bcd97d94aee42788c6c1bf4 /media/base/multi_channel_resampler.h | |
parent | bfa6c1d83fc19226ad8c2ffd3bb958955b26279a (diff) | |
download | chromium_src-a70013babca3b661bbc3ef198ad2f58c88ec4078.zip chromium_src-a70013babca3b661bbc3ef198ad2f58c88ec4078.tar.gz chromium_src-a70013babca3b661bbc3ef198ad2f58c88ec4078.tar.bz2 |
Reduce jitter from uneven SincResampler buffer size requests.
Ensures all buffer requests are for the same size. Reduces jitter
by allowing clients with specific buffer size requirements to avoid
overreading.
BUG=none
TEST=media_unittests.
R=crogers@google.com, henrika@chromium.org, sergeyu@chromium.org
Review URL: https://codereview.chromium.org/14189035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199032 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/multi_channel_resampler.h')
-rw-r--r-- | media/base/multi_channel_resampler.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/media/base/multi_channel_resampler.h b/media/base/multi_channel_resampler.h index 549ddea..88b7ceb 100644 --- a/media/base/multi_channel_resampler.h +++ b/media/base/multi_channel_resampler.h @@ -27,13 +27,16 @@ class MEDIA_EXPORT MultiChannelResampler { // Constructs a MultiChannelResampler with the specified |read_cb|, which is // used to acquire audio data for resampling. |io_sample_rate_ratio| is the - // ratio of input / output sample rates. - MultiChannelResampler(int channels, double io_sample_rate_ratio, + // ratio of input / output sample rates. |request_frames| is the size in + // frames of the AudioBus to be filled by |read_cb|. + MultiChannelResampler(int channels, + double io_sample_rate_ratio, + size_t request_frames, const ReadCB& read_cb); virtual ~MultiChannelResampler(); // Resamples |frames| of data from |read_cb_| into AudioBus. - void Resample(AudioBus* audio_bus, int frames); + void Resample(int frames, AudioBus* audio_bus); // Flush all buffered data and reset internal indices. Not thread safe, do // not call while Resample() is in progress. @@ -47,7 +50,7 @@ class MEDIA_EXPORT MultiChannelResampler { private: // SincResampler::ReadCB implementation. ProvideInput() will be called for // each channel (in channel order) as SincResampler needs more data. - void ProvideInput(int channel, float* destination, int frames); + void ProvideInput(int channel, int frames, float* destination); // Sanity check to ensure that ProvideInput() retrieves the same number of // frames for every channel. |