| 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_input_mac.h" | 5 #include "media/audio/mac/audio_input_mac.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/mac_logging.h" | 9 #include "base/mac/mac_logging.h" |
| 10 #include "media/audio/audio_manager_base.h" | 10 #include "media/audio/audio_manager_base.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 NOTREACHED() << "Only supported for low-latency mode."; | 129 NOTREACHED() << "Only supported for low-latency mode."; |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool PCMQueueInAudioInputStream::GetAutomaticGainControl() { | 132 bool PCMQueueInAudioInputStream::GetAutomaticGainControl() { |
| 133 NOTREACHED() << "Only supported for low-latency mode."; | 133 NOTREACHED() << "Only supported for low-latency mode."; |
| 134 return false; | 134 return false; |
| 135 } | 135 } |
| 136 | 136 |
| 137 void PCMQueueInAudioInputStream::HandleError(OSStatus err) { | 137 void PCMQueueInAudioInputStream::HandleError(OSStatus err) { |
| 138 if (callback_) | 138 if (callback_) |
| 139 callback_->OnError(this, static_cast<int>(err)); | 139 callback_->OnError(this); |
| 140 // This point should never be reached. | 140 // This point should never be reached. |
| 141 OSSTATUS_DCHECK(0, err); | 141 OSSTATUS_DCHECK(0, err); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool PCMQueueInAudioInputStream::SetupBuffers() { | 144 bool PCMQueueInAudioInputStream::SetupBuffers() { |
| 145 DCHECK(buffer_size_bytes_); | 145 DCHECK(buffer_size_bytes_); |
| 146 for (int i = 0; i < kNumberBuffers; ++i) { | 146 for (int i = 0; i < kNumberBuffers; ++i) { |
| 147 AudioQueueBufferRef buffer; | 147 AudioQueueBufferRef buffer; |
| 148 OSStatus err = AudioQueueAllocateBuffer(audio_queue_, | 148 OSStatus err = AudioQueueAllocateBuffer(audio_queue_, |
| 149 buffer_size_bytes_, | 149 buffer_size_bytes_, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // complications than it solves (memory barrier issues accessing it from | 227 // complications than it solves (memory barrier issues accessing it from |
| 228 // multiple threads, looses the means to indicate OnClosed to client). | 228 // multiple threads, looses the means to indicate OnClosed to client). |
| 229 // Should determine if we need to do something equivalent here. | 229 // Should determine if we need to do something equivalent here. |
| 230 return; | 230 return; |
| 231 } | 231 } |
| 232 HandleError(err); | 232 HandleError(err); |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 | 235 |
| 236 } // namespace media | 236 } // namespace media |
| OLD | NEW |