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

Unified Diff: media/audio/audio_input_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_input_device.cc
diff --git a/media/audio/audio_input_device.cc b/media/audio/audio_input_device.cc
index 401042acf26d8cded7a7f25fd12611a238620a61..c4954313b918525c60f4f207936635c15ad2a0d7 100644
--- a/media/audio/audio_input_device.cc
+++ b/media/audio/audio_input_device.cc
@@ -10,6 +10,7 @@
#include "base/time.h"
#include "media/audio/audio_manager_base.h"
#include "media/audio/audio_util.h"
+#include "media/base/audio_bus.h"
namespace media {
@@ -328,24 +329,23 @@ void AudioInputDevice::AudioThreadCallback::Process(int pending_data) {
int audio_delay_milliseconds = pending_data / bytes_per_ms_;
int16* memory = reinterpret_cast<int16*>(&buffer->audio[0]);
- const size_t number_of_frames = audio_parameters_.frames_per_buffer();
const int bytes_per_sample = sizeof(memory[0]);
// Deinterleave each channel and convert to 32-bit floating-point
// with nominal range -1.0 -> +1.0.
- for (int channel_index = 0; channel_index < audio_parameters_.channels();
+ for (int channel_index = 0; channel_index < audio_bus_->channels();
++channel_index) {
DeinterleaveAudioChannel(memory,
- audio_data_[channel_index],
- audio_parameters_.channels(),
+ audio_bus_->channel(channel_index),
+ audio_bus_->channels(),
channel_index,
bytes_per_sample,
- number_of_frames);
+ audio_bus_->frames());
}
// Deliver captured data to the client in floating point format
// and update the audio-delay measurement.
- capture_callback_->Capture(audio_data_, number_of_frames,
+ capture_callback_->Capture(audio_bus_.get(), audio_bus_->frames(),
audio_delay_milliseconds, volume);
}

Powered by Google App Engine
This is Rietveld 408576698