| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "media/audio/mac/audio_output_mac.h" | 6 #include "media/audio/mac/audio_output_mac.h" |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 void PCMQueueOutAudioOutputStream::SetVolume(double left_level, | 138 void PCMQueueOutAudioOutputStream::SetVolume(double left_level, |
| 139 double right_level) { | 139 double right_level) { |
| 140 // TODO(cpu): Implement. | 140 // TODO(cpu): Implement. |
| 141 } | 141 } |
| 142 | 142 |
| 143 void PCMQueueOutAudioOutputStream::GetVolume(double* left_level, | 143 void PCMQueueOutAudioOutputStream::GetVolume(double* left_level, |
| 144 double* right_level) { | 144 double* right_level) { |
| 145 // TODO(cpu): Implement. | 145 // TODO(cpu): Implement. |
| 146 } | 146 } |
| 147 | 147 |
| 148 size_t PCMQueueOutAudioOutputStream::GetNumBuffers() { | |
| 149 return kNumBuffers; | |
| 150 } | |
| 151 | |
| 152 // Note to future hackers of this function: Do not add locks here because we | 148 // Note to future hackers of this function: Do not add locks here because we |
| 153 // call out to third party source that might do crazy things including adquire | 149 // call out to third party source that might do crazy things including adquire |
| 154 // external locks or somehow re-enter here because its legal for them to call | 150 // external locks or somehow re-enter here because its legal for them to call |
| 155 // some audio functions. | 151 // some audio functions. |
| 156 void PCMQueueOutAudioOutputStream::RenderCallback(void* p_this, | 152 void PCMQueueOutAudioOutputStream::RenderCallback(void* p_this, |
| 157 AudioQueueRef queue, | 153 AudioQueueRef queue, |
| 158 AudioQueueBufferRef buffer) { | 154 AudioQueueBufferRef buffer) { |
| 159 PCMQueueOutAudioOutputStream* audio_stream = | 155 PCMQueueOutAudioOutputStream* audio_stream = |
| 160 static_cast<PCMQueueOutAudioOutputStream*>(p_this); | 156 static_cast<PCMQueueOutAudioOutputStream*>(p_this); |
| 161 // Call the audio source to fill the free buffer with data. Not having a | 157 // Call the audio source to fill the free buffer with data. Not having a |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // Queue the buffers to the audio driver, sounds starts now. | 198 // Queue the buffers to the audio driver, sounds starts now. |
| 203 for(size_t ix = 0; ix != kNumBuffers; ++ix) { | 199 for(size_t ix = 0; ix != kNumBuffers; ++ix) { |
| 204 err = AudioQueueEnqueueBuffer(audio_queue_, buffer_[ix], 0, NULL); | 200 err = AudioQueueEnqueueBuffer(audio_queue_, buffer_[ix], 0, NULL); |
| 205 if (err != noErr) { | 201 if (err != noErr) { |
| 206 HandleError(err); | 202 HandleError(err); |
| 207 return; | 203 return; |
| 208 } | 204 } |
| 209 } | 205 } |
| 210 } | 206 } |
| 211 | 207 |
| OLD | NEW |