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/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/debug/trace_event.h" | 11 #include "base/debug/trace_event.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/mac/mac_logging.h" | 13 #include "base/mac/mac_logging.h" |
14 #include "media/audio/mac/audio_manager_mac.h" | 14 #include "media/audio/mac/audio_manager_mac.h" |
15 #include "media/base/media_switches.h" | 15 #include "media/base/media_switches.h" |
16 | 16 |
17 namespace media { | 17 namespace media { |
18 | 18 |
19 static std::ostream& operator<<(std::ostream& os, | |
20 const AudioStreamBasicDescription& format) { | |
21 os << "sample rate : " << format.mSampleRate << std::endl | |
22 << "format ID : " << format.mFormatID << std::endl | |
23 << "format flags : " << format.mFormatFlags << std::endl | |
24 << "bytes per packet : " << format.mBytesPerPacket << std::endl | |
25 << "frames per packet : " << format.mFramesPerPacket << std::endl | |
26 << "bytes per frame : " << format.mBytesPerFrame << std::endl | |
27 << "channels per frame: " << format.mChannelsPerFrame << std::endl | |
28 << "bits per channel : " << format.mBitsPerChannel; | |
29 return os; | |
30 } | |
31 | |
32 static void ZeroBufferList(AudioBufferList* buffer_list) { | 19 static void ZeroBufferList(AudioBufferList* buffer_list) { |
33 for (size_t i = 0; i < buffer_list->mNumberBuffers; ++i) { | 20 for (size_t i = 0; i < buffer_list->mNumberBuffers; ++i) { |
34 memset(buffer_list->mBuffers[i].mData, | 21 memset(buffer_list->mBuffers[i].mData, |
35 0, | 22 0, |
36 buffer_list->mBuffers[i].mDataByteSize); | 23 buffer_list->mBuffers[i].mDataByteSize); |
37 } | 24 } |
38 } | 25 } |
39 | 26 |
40 static void WrapBufferList(AudioBufferList* buffer_list, | 27 static void WrapBufferList(AudioBufferList* buffer_list, |
41 AudioBus* bus, | 28 AudioBus* bus, |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 result = AudioUnitInitialize(audio_unit_); | 523 result = AudioUnitInitialize(audio_unit_); |
537 if (result != noErr) { | 524 if (result != noErr) { |
538 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; | 525 OSSTATUS_DLOG(ERROR, result) << "AudioUnitInitialize() failed."; |
539 return false; | 526 return false; |
540 } | 527 } |
541 | 528 |
542 return true; | 529 return true; |
543 } | 530 } |
544 | 531 |
545 } // namespace media | 532 } // namespace media |
OLD | NEW |