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 current_hardware_pending_bytes_ + | 231 AudioBuffersState(0, |
232 frame_delay * params_.GetBytesPerFrame()); | 232 current_hardware_pending_bytes_ + |
| 233 frame_delay * params_.GetBytesPerFrame())); |
233 dest->Scale(volume_); | 234 dest->Scale(volume_); |
234 } | 235 } |
235 | 236 |
236 // AUHAL callback. | 237 // AUHAL callback. |
237 OSStatus AUHALStream::InputProc( | 238 OSStatus AUHALStream::InputProc( |
238 void* user_data, | 239 void* user_data, |
239 AudioUnitRenderActionFlags* flags, | 240 AudioUnitRenderActionFlags* flags, |
240 const AudioTimeStamp* output_time_stamp, | 241 const AudioTimeStamp* output_time_stamp, |
241 UInt32 bus_number, | 242 UInt32 bus_number, |
242 UInt32 number_of_frames, | 243 UInt32 number_of_frames, |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 result = AudioUnitInitialize(audio_unit_); | 467 result = AudioUnitInitialize(audio_unit_); |
467 if (result != noErr) { | 468 if (result != noErr) { |
468 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; | 469 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; |
469 return false; | 470 return false; |
470 } | 471 } |
471 | 472 |
472 return true; | 473 return true; |
473 } | 474 } |
474 | 475 |
475 } // namespace media | 476 } // namespace media |
OLD | NEW |