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

Unified Diff: media/base/multi_channel_resampler.h

Issue 14969017: Cleanup and reduce memory usage for MultiChannelResampler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup. Created 7 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 | « no previous file | media/base/multi_channel_resampler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/multi_channel_resampler.h
diff --git a/media/base/multi_channel_resampler.h b/media/base/multi_channel_resampler.h
index 88b7ceb54a6e8052f734204083192e355ab1e430..148cb9da78a5982c96472d5840a1730b99f21af8 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.
« no previous file with comments | « no previous file | media/base/multi_channel_resampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698