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

Side by Side Diff: trunk/src/media/audio/mac/audio_auhal_mac.cc

Issue 487543002: Revert 290359 "Remove AudioBuffersState class." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « trunk/src/media/audio/fake_audio_output_stream.cc ('k') | trunk/src/media/audio/mock_audio_source_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698