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

Unified Diff: media/audio/audio_output_device.cc

Issue 10823175: Switch AudioRenderSink::Callback to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gotta catch'em all! Created 8 years, 4 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
Index: media/audio/audio_output_device.cc
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc
index eff1a0cbc0156af26ce966560fdedafd34f84c53..53d5236697b260be0338b33465b58bb1c64aab26 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_bus_->frames(), 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(), audio_bus_->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());
}

Powered by Google App Engine
This is Rietveld 408576698