| 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 20 matching lines...) Expand all Loading... |
| 31 // 1) Hardware latency, which includes Audio Unit latency, audio device | 31 // 1) Hardware latency, which includes Audio Unit latency, audio device |
| 32 // latency; | 32 // latency; |
| 33 // 2) The delay between the actual recording instant and the time when the | 33 // 2) The delay between the actual recording instant and the time when the |
| 34 // data packet is provided as a callback. | 34 // data packet is provided as a callback. |
| 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 | 40 |
| 41 #include "base/atomicops.h" |
| 41 #include "base/memory/scoped_ptr.h" | 42 #include "base/memory/scoped_ptr.h" |
| 42 #include "base/synchronization/lock.h" | 43 #include "base/synchronization/lock.h" |
| 44 #include "base/time.h" |
| 43 #include "media/audio/audio_io.h" | 45 #include "media/audio/audio_io.h" |
| 46 #include "media/audio/audio_input_stream_impl.h" |
| 44 #include "media/audio/audio_parameters.h" | 47 #include "media/audio/audio_parameters.h" |
| 45 | 48 |
| 46 class AudioManagerMac; | 49 class AudioManagerMac; |
| 47 | 50 |
| 48 class AUAudioInputStream : public AudioInputStream { | 51 class AUAudioInputStream : public AudioInputStreamImpl { |
| 49 public: | 52 public: |
| 50 // The ctor takes all the usual parameters, plus |manager| which is the | 53 // The ctor takes all the usual parameters, plus |manager| which is the |
| 51 // the audio manager who is creating this object. | 54 // the audio manager who is creating this object. |
| 52 AUAudioInputStream(AudioManagerMac* manager, | 55 AUAudioInputStream(AudioManagerMac* manager, |
| 53 const AudioParameters& params, | 56 const AudioParameters& params, |
| 54 AudioDeviceID audio_device_id); | 57 AudioDeviceID audio_device_id); |
| 55 // The dtor is typically called by the AudioManager only and it is usually | 58 // The dtor is typically called by the AudioManager only and it is usually |
| 56 // triggered by calling AudioInputStream::Close(). | 59 // triggered by calling AudioInputStream::Close(). |
| 57 virtual ~AUAudioInputStream(); | 60 virtual ~AUAudioInputStream(); |
| 58 | 61 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 double hardware_latency_frames_; | 140 double hardware_latency_frames_; |
| 138 | 141 |
| 139 // The number of channels in each frame of audio data, which is used | 142 // The number of channels in each frame of audio data, which is used |
| 140 // when querying the volume of each channel. | 143 // when querying the volume of each channel. |
| 141 int number_of_channels_in_frame_; | 144 int number_of_channels_in_frame_; |
| 142 | 145 |
| 143 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 146 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| 144 }; | 147 }; |
| 145 | 148 |
| 146 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 149 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| OLD | NEW |