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 // Implementation of AudioInputStream for Mac OS X using the special AUHAL | 5 // Implementation of AudioInputStream for Mac OS X using the special AUHAL |
6 // input Audio Unit present in OS 10.4 and later. | 6 // input Audio Unit present in OS 10.4 and later. |
7 // The AUHAL input Audio Unit is for low-latency audio I/O. | 7 // The AUHAL input Audio Unit is for low-latency audio I/O. |
8 // | 8 // |
9 // Overview of operation: | 9 // Overview of operation: |
10 // | 10 // |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "base/cancelable_callback.h" | 42 #include "base/cancelable_callback.h" |
43 #include "base/memory/scoped_ptr.h" | 43 #include "base/memory/scoped_ptr.h" |
44 #include "base/synchronization/lock.h" | 44 #include "base/synchronization/lock.h" |
45 #include "media/audio/agc_audio_stream.h" | 45 #include "media/audio/agc_audio_stream.h" |
46 #include "media/audio/audio_io.h" | 46 #include "media/audio/audio_io.h" |
47 #include "media/audio/audio_parameters.h" | 47 #include "media/audio/audio_parameters.h" |
48 #include "media/base/seekable_buffer.h" | 48 #include "media/base/seekable_buffer.h" |
49 | 49 |
50 namespace media { | 50 namespace media { |
51 | 51 |
52 class AudioBus; | |
53 class AudioManagerMac; | 52 class AudioManagerMac; |
54 class DataBuffer; | 53 class DataBuffer; |
55 | 54 |
56 class AUAudioInputStream : public AgcAudioStream<AudioInputStream> { | 55 class AUAudioInputStream : public AgcAudioStream<AudioInputStream> { |
57 public: | 56 public: |
58 // The ctor takes all the usual parameters, plus |manager| which is the | 57 // The ctor takes all the usual parameters, plus |manager| which is the |
59 // the audio manager who is creating this object. | 58 // the audio manager who is creating this object. |
60 AUAudioInputStream(AudioManagerMac* manager, | 59 AUAudioInputStream(AudioManagerMac* manager, |
61 const AudioParameters& input_params, | 60 const AudioParameters& input_params, |
62 const AudioParameters& output_params, | 61 const AudioParameters& output_params, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // client using the OnData() callback. | 158 // client using the OnData() callback. |
160 scoped_refptr<media::DataBuffer> data_; | 159 scoped_refptr<media::DataBuffer> data_; |
161 | 160 |
162 // The client requests that the recorded data shall be delivered using | 161 // The client requests that the recorded data shall be delivered using |
163 // OnData() callbacks where each callback contains this amount of bytes. | 162 // OnData() callbacks where each callback contains this amount of bytes. |
164 int requested_size_bytes_; | 163 int requested_size_bytes_; |
165 | 164 |
166 // Used to defer Start() to workaround http://crbug.com/160920. | 165 // Used to defer Start() to workaround http://crbug.com/160920. |
167 base::CancelableClosure deferred_start_cb_; | 166 base::CancelableClosure deferred_start_cb_; |
168 | 167 |
169 // Extra audio bus used for storage of deinterleaved data for the OnData | |
170 // callback. | |
171 scoped_ptr<media::AudioBus> audio_bus_; | |
172 | |
173 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 168 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
174 }; | 169 }; |
175 | 170 |
176 } // namespace media | 171 } // namespace media |
177 | 172 |
178 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 173 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
OLD | NEW |