diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 19:32:23 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-10 19:32:23 +0000 |
commit | 2939ba26e70f3fca003d110e96ea3452146bce09 (patch) | |
tree | 184b8b6a504588f718b4700ebe7db366366171fd /media/base/multi_channel_resampler.h | |
parent | e85797cd8652628481291a6c202e150d1f8adf78 (diff) | |
download | chromium_src-2939ba26e70f3fca003d110e96ea3452146bce09.zip chromium_src-2939ba26e70f3fca003d110e96ea3452146bce09.tar.gz chromium_src-2939ba26e70f3fca003d110e96ea3452146bce09.tar.bz2 |
Cleanup and reduce memory usage for MultiChannelResampler.
Removes a vector allocation and an allocation for an unused channel
in favor of AudioBus::CreateWrapper(). These allocations are also
moved to the constructor now that SincResampler will always ask for
the same amount of data.
BUG=none
TEST=media_unittests
Review URL: https://chromiumcodereview.appspot.com/14969017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199521 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/multi_channel_resampler.h')
-rw-r--r-- | media/base/multi_channel_resampler.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/media/base/multi_channel_resampler.h b/media/base/multi_channel_resampler.h index 88b7ceb..148cb9d 100644 --- a/media/base/multi_channel_resampler.h +++ b/media/base/multi_channel_resampler.h @@ -52,10 +52,6 @@ class MEDIA_EXPORT MultiChannelResampler { // each channel (in channel order) as SincResampler needs more data. void ProvideInput(int channel, int frames, float* destination); - // Sanity check to ensure that ProvideInput() retrieves the same number of - // frames for every channel. - int last_frame_count_; - // Source of data for resampling. ReadCB read_cb_; @@ -64,8 +60,10 @@ class MEDIA_EXPORT MultiChannelResampler { // Buffers for audio data going into SincResampler from ReadCB. scoped_ptr<AudioBus> resampler_audio_bus_; + + // To avoid a memcpy() on the first channel we create a wrapped AudioBus where + // the first channel points to the |destination| provided to ProvideInput(). scoped_ptr<AudioBus> wrapped_resampler_audio_bus_; - std::vector<float*> resampler_audio_data_; // The number of output frames that have successfully been processed during // the current Resample() call. |