| 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 24 matching lines...) Expand all Loading... |
| 35 // | 35 // |
| 36 #ifndef MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 36 #ifndef MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| 37 #define MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 37 #define MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| 38 | 38 |
| 39 #include <AudioUnit/AudioUnit.h> | 39 #include <AudioUnit/AudioUnit.h> |
| 40 #include <CoreAudio/CoreAudio.h> | 40 #include <CoreAudio/CoreAudio.h> |
| 41 | 41 |
| 42 #include "base/atomicops.h" | 42 #include "base/atomicops.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/audio_io.h" | 46 #include "media/audio/audio_io.h" |
| 46 #include "media/audio/audio_input_stream_impl.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 AudioManagerMac; | 52 class AudioManagerMac; |
| 53 class DataBuffer; | 53 class DataBuffer; |
| 54 | 54 |
| 55 class AUAudioInputStream : public AudioInputStreamImpl { | 55 class AUAudioInputStream : public AgcAudioStream<AudioInputStream> { |
| 56 public: | 56 public: |
| 57 // 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 |
| 58 // the audio manager who is creating this object. | 58 // the audio manager who is creating this object. |
| 59 AUAudioInputStream(AudioManagerMac* manager, | 59 AUAudioInputStream(AudioManagerMac* manager, |
| 60 const AudioParameters& params, | 60 const AudioParameters& params, |
| 61 AudioDeviceID audio_device_id); | 61 AudioDeviceID audio_device_id); |
| 62 // The dtor is typically called by the AudioManager only and it is usually | 62 // The dtor is typically called by the AudioManager only and it is usually |
| 63 // triggered by calling AudioInputStream::Close(). | 63 // triggered by calling AudioInputStream::Close(). |
| 64 virtual ~AUAudioInputStream(); | 64 virtual ~AUAudioInputStream(); |
| 65 | 65 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // The client requests that the recorded data shall be delivered using | 157 // The client requests that the recorded data shall be delivered using |
| 158 // OnData() callbacks where each callback contains this amount of bytes. | 158 // OnData() callbacks where each callback contains this amount of bytes. |
| 159 int requested_size_bytes_; | 159 int requested_size_bytes_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 161 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // namespace media | 164 } // namespace media |
| 165 | 165 |
| 166 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 166 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| OLD | NEW |