OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/mac/audio_auhal_mac.h" | 5 #include "media/audio/mac/audio_auhal_mac.h" |
6 | 6 |
7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 void AUHALStream::ProvideInput(int frame_delay, AudioBus* dest) { | 221 void AUHALStream::ProvideInput(int frame_delay, AudioBus* dest) { |
222 base::AutoLock auto_lock(source_lock_); | 222 base::AutoLock auto_lock(source_lock_); |
223 if (!source_) { | 223 if (!source_) { |
224 dest->Zero(); | 224 dest->Zero(); |
225 return; | 225 return; |
226 } | 226 } |
227 | 227 |
228 // Supply the input data and render the output data. | 228 // Supply the input data and render the output data. |
229 source_->OnMoreData( | 229 source_->OnMoreData( |
230 dest, | 230 dest, |
231 AudioBuffersState(0, | 231 current_hardware_pending_bytes_ + |
232 current_hardware_pending_bytes_ + | 232 frame_delay * params_.GetBytesPerFrame()); |
233 frame_delay * params_.GetBytesPerFrame())); | |
234 dest->Scale(volume_); | 233 dest->Scale(volume_); |
235 } | 234 } |
236 | 235 |
237 // AUHAL callback. | 236 // AUHAL callback. |
238 OSStatus AUHALStream::InputProc( | 237 OSStatus AUHALStream::InputProc( |
239 void* user_data, | 238 void* user_data, |
240 AudioUnitRenderActionFlags* flags, | 239 AudioUnitRenderActionFlags* flags, |
241 const AudioTimeStamp* output_time_stamp, | 240 const AudioTimeStamp* output_time_stamp, |
242 UInt32 bus_number, | 241 UInt32 bus_number, |
243 UInt32 number_of_frames, | 242 UInt32 number_of_frames, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 result = AudioUnitInitialize(audio_unit_); | 466 result = AudioUnitInitialize(audio_unit_); |
468 if (result != noErr) { | 467 if (result != noErr) { |
469 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; | 468 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; |
470 return false; | 469 return false; |
471 } | 470 } |
472 | 471 |
473 return true; | 472 return true; |
474 } | 473 } |
475 | 474 |
476 } // namespace media | 475 } // namespace media |
OLD | NEW |