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

Unified Diff: trunk/src/media/audio/mac/audio_low_latency_input_mac.cc

Issue 335343004: Revert 277794 "Modifies AudioInputCallback::OnData and use media..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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
Index: trunk/src/media/audio/mac/audio_low_latency_input_mac.cc
===================================================================
--- trunk/src/media/audio/mac/audio_low_latency_input_mac.cc (revision 277811)
+++ trunk/src/media/audio/mac/audio_low_latency_input_mac.cc (working copy)
@@ -10,7 +10,6 @@
#include "base/logging.h"
#include "base/mac/mac_logging.h"
#include "media/audio/mac/audio_manager_mac.h"
-#include "media/base/audio_bus.h"
#include "media/base/data_buffer.h"
namespace media {
@@ -32,10 +31,11 @@
// http://developer.apple.com/library/mac/#technotes/tn2091/_index.html
// for more details and background regarding this implementation.
-AUAudioInputStream::AUAudioInputStream(AudioManagerMac* manager,
- const AudioParameters& input_params,
- const AudioParameters& output_params,
- AudioDeviceID audio_device_id)
+AUAudioInputStream::AUAudioInputStream(
+ AudioManagerMac* manager,
+ const AudioParameters& input_params,
+ const AudioParameters& output_params,
+ AudioDeviceID audio_device_id)
: manager_(manager),
sink_(NULL),
audio_unit_(0),
@@ -43,8 +43,7 @@
started_(false),
hardware_latency_frames_(0),
fifo_delay_bytes_(0),
- number_of_channels_in_frame_(0),
- audio_bus_(media::AudioBus::Create(input_params)) {
+ number_of_channels_in_frame_(0) {
DCHECK(manager_);
// Set up the desired (output) format specified by the client.
@@ -543,13 +542,12 @@
// Read from FIFO into temporary data buffer.
fifo_->Read(data_->writable_data(), requested_size_bytes_);
- // Copy captured (and interleaved) data into deinterleaved audio bus.
- audio_bus_->FromInterleaved(
- data_->data(), audio_bus_->frames(), format_.mBitsPerChannel / 8);
-
// Deliver data packet, delay estimation and volume level to the user.
- sink_->OnData(
- this, audio_bus_.get(), capture_delay_bytes, normalized_volume);
+ sink_->OnData(this,
+ data_->data(),
+ requested_size_bytes_,
+ capture_delay_bytes,
+ normalized_volume);
}
return noErr;

Powered by Google App Engine
This is Rietveld 408576698