OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_manager_mac.h" | 5 #include "media/audio/mac/audio_manager_mac.h" |
6 | 6 |
7 #include <CoreAudio/AudioHardware.h> | 7 #include <CoreAudio/AudioHardware.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 // see this case. | 538 // see this case. |
539 NOTREACHED() << "Only stereo input is currently supported!"; | 539 NOTREACHED() << "Only stereo input is currently supported!"; |
540 return NULL; | 540 return NULL; |
541 } | 541 } |
542 | 542 |
543 AudioDeviceID device = kAudioObjectUnknown; | 543 AudioDeviceID device = kAudioObjectUnknown; |
544 if (HasUnifiedDefaultIO()) { | 544 if (HasUnifiedDefaultIO()) { |
545 // For I/O, the simplest case is when the default input and output | 545 // For I/O, the simplest case is when the default input and output |
546 // devices are the same. | 546 // devices are the same. |
547 GetDefaultOutputDevice(&device); | 547 GetDefaultOutputDevice(&device); |
548 LOG(INFO) << "UNIFIED: default input and output devices are identical"; | 548 VLOG(0) << "UNIFIED: default input and output devices are identical"; |
549 } else { | 549 } else { |
550 // Some audio hardware is presented as separate input and output devices | 550 // Some audio hardware is presented as separate input and output devices |
551 // even though they are really the same physical hardware and | 551 // even though they are really the same physical hardware and |
552 // share the same "clock domain" at the lowest levels of the driver. | 552 // share the same "clock domain" at the lowest levels of the driver. |
553 // A common of example of this is the "built-in" audio hardware: | 553 // A common of example of this is the "built-in" audio hardware: |
554 // "Built-in Line Input" | 554 // "Built-in Line Input" |
555 // "Built-in Output" | 555 // "Built-in Output" |
556 // We would like to use an "aggregate" device for these situations, since | 556 // We would like to use an "aggregate" device for these situations, since |
557 // CoreAudio will make the most efficient use of the shared "clock domain" | 557 // CoreAudio will make the most efficient use of the shared "clock domain" |
558 // so we get the lowest latency and use fewer threads. | 558 // so we get the lowest latency and use fewer threads. |
559 device = aggregate_device_manager_.GetDefaultAggregateDevice(); | 559 device = aggregate_device_manager_.GetDefaultAggregateDevice(); |
560 if (device != kAudioObjectUnknown) | 560 if (device != kAudioObjectUnknown) |
561 LOG(INFO) << "Using AGGREGATE audio device"; | 561 VLOG(0) << "Using AGGREGATE audio device"; |
562 } | 562 } |
563 | 563 |
564 if (device != kAudioObjectUnknown && | 564 if (device != kAudioObjectUnknown && |
565 input_device_id == AudioManagerBase::kDefaultDeviceId) | 565 input_device_id == AudioManagerBase::kDefaultDeviceId) |
566 return new AUHALStream(this, params, device); | 566 return new AUHALStream(this, params, device); |
567 | 567 |
568 // Fallback to AudioSynchronizedStream which will handle completely | 568 // Fallback to AudioSynchronizedStream which will handle completely |
569 // different and arbitrary combinations of input and output devices | 569 // different and arbitrary combinations of input and output devices |
570 // even running at different sample-rates. | 570 // even running at different sample-rates. |
571 // kAudioDeviceUnknown translates to "use default" here. | 571 // kAudioDeviceUnknown translates to "use default" here. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 } | 740 } |
741 | 741 |
742 return buffer_size; | 742 return buffer_size; |
743 } | 743 } |
744 | 744 |
745 AudioManager* CreateAudioManager() { | 745 AudioManager* CreateAudioManager() { |
746 return new AudioManagerMac(); | 746 return new AudioManagerMac(); |
747 } | 747 } |
748 | 748 |
749 } // namespace media | 749 } // namespace media |
OLD | NEW |