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

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

Issue 481193003: Remove AudioBuffersState usage in Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix audio muter build buster. Created 6 years, 2 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
« no previous file with comments | « media/audio/fake_audio_output_stream.cc ('k') | media/audio/mock_audio_source_callback.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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
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
OLDNEW
« no previous file with comments | « media/audio/fake_audio_output_stream.cc ('k') | media/audio/mock_audio_source_callback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698