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

Unified Diff: media/audio/alsa/alsa_input.cc

Issue 314713002: Modifies AudioInputCallback::OnData and use media::AudioBus instead of plain byte vector (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: media/audio/alsa/alsa_input.cc
diff --git a/media/audio/alsa/alsa_input.cc b/media/audio/alsa/alsa_input.cc
index 9cde236b59154f221b5242483aa130956692a6c1..5a0ee5aaef5e1d64c1dac212bbbe131a7ff2dde6 100644
--- a/media/audio/alsa/alsa_input.cc
+++ b/media/audio/alsa/alsa_input.cc
@@ -43,6 +43,7 @@ AlsaPcmInputStream::AlsaPcmInputStream(AudioManagerBase* audio_manager,
mixer_handle_(NULL),
mixer_element_handle_(NULL),
read_callback_behind_schedule_(false),
+ audio_bus_(AudioBus::Create(params)),
weak_factory_(this) {}
AlsaPcmInputStream::~AlsaPcmInputStream() {}
@@ -208,8 +209,11 @@ void AlsaPcmInputStream::ReadAudio() {
int frames_read = wrapper_->PcmReadi(device_handle_, audio_buffer_.get(),
params_.frames_per_buffer());
if (frames_read == params_.frames_per_buffer()) {
- callback_->OnData(this, audio_buffer_.get(), bytes_per_buffer_,
- hardware_delay_bytes, normalized_volume);
+ audio_bus_->FromInterleaved(
+ audio_buffer_.get(), audio_bus_->frames(),
+ params_.bits_per_sample() / 8);
+ callback_->OnData(this, audio_bus_.get(), hardware_delay_bytes,
DaleCurtis 2014/06/03 21:03:06 Formatting is wrong, run this section through clan
henrika (OOO until Aug 14) 2014/06/04 07:50:23 Thx. Done. CL was not cleaned up. Mainly wanted to
+ normalized_volume);
} else {
LOG(WARNING) << "PcmReadi returning less than expected frames: "
<< frames_read << " vs. " << params_.frames_per_buffer()

Powered by Google App Engine
This is Rietveld 408576698