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

Unified Diff: media/audio/pulse/pulse_input.cc

Issue 344583002: Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector (Relanding) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added extra non-pure OnData API Created 6 years, 6 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 | « media/audio/pulse/pulse_input.h ('k') | media/audio/pulse/pulse_output.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/pulse/pulse_input.cc
diff --git a/media/audio/pulse/pulse_input.cc b/media/audio/pulse/pulse_input.cc
index 9d31cddd735ff291713ae24c5e6e6f410008df8d..d5cb94ece22fa09dff7aed7e730d463de037b689 100644
--- a/media/audio/pulse/pulse_input.cc
+++ b/media/audio/pulse/pulse_input.cc
@@ -34,6 +34,8 @@ PulseAudioInputStream::PulseAudioInputStream(AudioManagerPulse* audio_manager,
context_state_changed_(false) {
DCHECK(mainloop);
DCHECK(context);
+ CHECK(params_.IsValid());
+ audio_bus_ = AudioBus::Create(params_);
}
PulseAudioInputStream::~PulseAudioInputStream() {
@@ -272,8 +274,11 @@ void PulseAudioInputStream::ReadData() {
int packet_size = params_.GetBytesPerBuffer();
while (buffer_->forward_bytes() >= packet_size) {
buffer_->Read(audio_data_buffer_.get(), packet_size);
- callback_->OnData(this, audio_data_buffer_.get(), packet_size,
- hardware_delay, normalized_volume);
+ audio_bus_->FromInterleaved(audio_data_buffer_.get(),
+ audio_bus_->frames(),
+ params_.bits_per_sample() / 8);
+ callback_->OnData(
+ this, audio_bus_.get(), hardware_delay, normalized_volume);
if (buffer_->forward_bytes() < packet_size)
break;
« no previous file with comments | « media/audio/pulse/pulse_input.h ('k') | media/audio/pulse/pulse_output.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698