diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 21:48:31 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-09 21:48:31 +0000 |
commit | 71cdf717853b37392d333bd89636a6a59c609ea2 (patch) | |
tree | b0ccdfbd4781c83c24fa7fe139bff637b044042d /media/audio/audio_output_device.cc | |
parent | 88031984f605e614c6269a13197c8cd58ce27b95 (diff) | |
download | chromium_src-71cdf717853b37392d333bd89636a6a59c609ea2.zip chromium_src-71cdf717853b37392d333bd89636a6a59c609ea2.tar.gz chromium_src-71cdf717853b37392d333bd89636a6a59c609ea2.tar.bz2 |
Switch AudioRenderSink::Callback to use AudioBus.
As titled, switches everything over to using the AudioBus
class instead of const std::vector<float*>. Allows removal
of lots of crufty allocations and memsets.
BUG=114700
TEST=unit tests, layout tests, try bots. Nothing should change.
Review URL: https://chromiumcodereview.appspot.com/10823175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_output_device.cc')
-rw-r--r-- | media/audio/audio_output_device.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc index eff1a0c..994fa40 100644 --- a/media/audio/audio_output_device.cc +++ b/media/audio/audio_output_device.cc @@ -266,17 +266,18 @@ void AudioOutputDevice::AudioThreadCallback::Process(int pending_data) { TRACE_EVENT0("audio", "AudioOutputDevice::FireRenderCallback"); // Update the audio-delay measurement then ask client to render audio. - size_t num_frames = render_callback_->Render(audio_data_, - audio_parameters_.frames_per_buffer(), audio_delay_milliseconds); + size_t num_frames = render_callback_->Render( + audio_bus_.get(), audio_delay_milliseconds); // Interleave, scale, and clip to int. - // TODO(crogers/vrk): Figure out a way to avoid the float -> int -> float - // conversions that happen in the <audio> and WebRTC scenarios. - InterleaveFloatToInt(audio_data_, shared_memory_.memory(), - num_frames, audio_parameters_.bits_per_sample() / 8); + // TODO(dalecurtis): Remove this when we have float everywhere. + InterleaveFloatToInt( + audio_bus_.get(), shared_memory_.memory(), num_frames, + audio_parameters_.bits_per_sample() / 8); // Let the host know we are done. - SetActualDataSizeInBytes(&shared_memory_, memory_length_, + SetActualDataSizeInBytes( + &shared_memory_, memory_length_, num_frames * audio_parameters_.GetBytesPerFrame()); } |