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 <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "media/audio/audio_util.h" | 11 #include "media/audio/audio_util.h" |
12 #include "media/audio/mac/audio_manager_mac.h" | 12 #include "media/audio/mac/audio_manager_mac.h" |
13 | 13 |
14 #if !defined(MAC_OS_X_VERSION_10_6) || \ | 14 #if !defined(MAC_OS_X_VERSION_10_6) || \ |
15 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 | 15 MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6 |
16 enum { | 16 enum { |
17 kAudioQueueErr_EnqueueDuringReset = -66632 | 17 kAudioQueueErr_EnqueueDuringReset = -66632 |
18 }; | 18 }; |
19 #endif | 19 #endif |
20 | 20 |
21 namespace media { | |
22 | |
23 PCMQueueInAudioInputStream::PCMQueueInAudioInputStream( | 21 PCMQueueInAudioInputStream::PCMQueueInAudioInputStream( |
24 AudioManagerMac* manager, const AudioParameters& params) | 22 AudioManagerMac* manager, const AudioParameters& params) |
25 : manager_(manager), | 23 : manager_(manager), |
26 callback_(NULL), | 24 callback_(NULL), |
27 audio_queue_(NULL), | 25 audio_queue_(NULL), |
28 buffer_size_bytes_(0), | 26 buffer_size_bytes_(0), |
29 started_(false) { | 27 started_(false) { |
30 // We must have a manager. | 28 // We must have a manager. |
31 DCHECK(manager_); | 29 DCHECK(manager_); |
32 // A frame is one sample across all channels. In interleaved audio the per | 30 // A frame is one sample across all channels. In interleaved audio the per |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an | 210 // TODO(joth): PCMQueueOutAudioOutputStream uses callback_ to provide an |
213 // extra guard for this situation, but it seems to introduce more | 211 // extra guard for this situation, but it seems to introduce more |
214 // complications than it solves (memory barrier issues accessing it from | 212 // complications than it solves (memory barrier issues accessing it from |
215 // multiple threads, looses the means to indicate OnClosed to client). | 213 // multiple threads, looses the means to indicate OnClosed to client). |
216 // Should determine if we need to do something equivalent here. | 214 // Should determine if we need to do something equivalent here. |
217 return; | 215 return; |
218 } | 216 } |
219 HandleError(err); | 217 HandleError(err); |
220 } | 218 } |
221 } | 219 } |
222 | |
223 } // namespace media | |
OLD | NEW |