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_output_mac.h" | 5 #include "media/audio/mac/audio_output_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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "media/audio/audio_util.h" | 13 #include "media/audio/audio_util.h" |
14 #include "media/audio/mac/audio_manager_mac.h" | 14 #include "media/audio/mac/audio_manager_mac.h" |
15 | 15 |
16 namespace media { | |
17 | |
18 // A custom data structure to store information an AudioQueue buffer. | 16 // A custom data structure to store information an AudioQueue buffer. |
19 struct AudioQueueUserData { | 17 struct AudioQueueUserData { |
20 AudioQueueUserData() : empty_buffer(false) {} | 18 AudioQueueUserData() : empty_buffer(false) {} |
21 bool empty_buffer; | 19 bool empty_buffer; |
22 }; | 20 }; |
23 | 21 |
24 // Overview of operation: | 22 // Overview of operation: |
25 // 1) An object of PCMQueueOutAudioOutputStream is created by the AudioManager | 23 // 1) An object of PCMQueueOutAudioOutputStream is created by the AudioManager |
26 // factory: audio_man->MakeAudioStream(). This just fills some structure. | 24 // factory: audio_man->MakeAudioStream(). This just fills some structure. |
27 // 2) Next some thread will call Open(), at that point the underliying OS | 25 // 2) Next some thread will call Open(), at that point the underliying OS |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 void PCMQueueOutAudioOutputStream::SetSource(AudioSourceCallback* source) { | 520 void PCMQueueOutAudioOutputStream::SetSource(AudioSourceCallback* source) { |
523 base::AutoLock lock(source_lock_); | 521 base::AutoLock lock(source_lock_); |
524 source_ = source; | 522 source_ = source; |
525 } | 523 } |
526 | 524 |
527 AudioOutputStream::AudioSourceCallback* | 525 AudioOutputStream::AudioSourceCallback* |
528 PCMQueueOutAudioOutputStream::GetSource() { | 526 PCMQueueOutAudioOutputStream::GetSource() { |
529 base::AutoLock lock(source_lock_); | 527 base::AutoLock lock(source_lock_); |
530 return source_; | 528 return source_; |
531 } | 529 } |
532 | |
533 } // namespace media | |
OLD | NEW |