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

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

Issue 12316131: Moved AudioUtil static functions to AudioManager interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: made the GetPreferredOutputStreamParameters protected Created 7 years, 10 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/mac/audio_device_listener_mac.cc ('k') | media/audio/mac/audio_low_latency_output_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_low_latency_input_mac.cc
diff --git a/media/audio/mac/audio_low_latency_input_mac.cc b/media/audio/mac/audio_low_latency_input_mac.cc
index 85eef1fb50b8e0b62c46935cbc76abecef824ae0..972ae392cebfea26731410bc0626555cc50b2b13 100644
--- a/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/media/audio/mac/audio_low_latency_input_mac.cc
@@ -67,7 +67,10 @@ AUAudioInputStream::AUAudioInputStream(
// Note that we use the same native buffer size as for the output side here
// since the AUHAL implementation requires that both capture and render side
// use the same buffer size. See http://crbug.com/154352 for more details.
- number_of_frames_ = GetAudioHardwareBufferSize();
+ // TODO(xians): Get the audio parameters from the right device.
+ const AudioParameters parameters =
+ manager_->GetInputStreamParameters(AudioManagerBase::kDefaultDeviceId);
+ number_of_frames_ = parameters.frames_per_buffer();
DVLOG(1) << "Size of data buffer in frames : " << number_of_frames_;
// Derive size (in bytes) of the buffers that we will render to.
@@ -225,7 +228,8 @@ bool AUAudioInputStream::Open() {
// Set the desired number of frames in the IO buffer (output scope).
// WARNING: Setting this value changes the frame size for all audio units in
// the current process. It's imperative that the input and output frame sizes
- // be the same as audio_util::GetAudioHardwareBufferSize().
+ // be the same as the frames_per_buffer() returned by
+ // GetInputStreamParameters().
// TODO(henrika): Due to http://crrev.com/159666 this is currently not true
// and should be fixed, a CHECK() should be added at that time.
result = AudioUnitSetProperty(audio_unit_,
« no previous file with comments | « media/audio/mac/audio_device_listener_mac.cc ('k') | media/audio/mac/audio_low_latency_output_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698