| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // The ctor takes all the usual parameters, plus |manager| which is the | 58 // The ctor takes all the usual parameters, plus |manager| which is the |
| 59 // the audio manager who is creating this object. | 59 // the audio manager who is creating this object. |
| 60 AUAudioInputStream(AudioManagerMac* manager, | 60 AUAudioInputStream(AudioManagerMac* manager, |
| 61 const AudioParameters& input_params, | 61 const AudioParameters& input_params, |
| 62 AudioDeviceID audio_device_id); | 62 AudioDeviceID audio_device_id); |
| 63 // The dtor is typically called by the AudioManager only and it is usually | 63 // The dtor is typically called by the AudioManager only and it is usually |
| 64 // triggered by calling AudioInputStream::Close(). | 64 // triggered by calling AudioInputStream::Close(). |
| 65 virtual ~AUAudioInputStream(); | 65 virtual ~AUAudioInputStream(); |
| 66 | 66 |
| 67 // Implementation of AudioInputStream. | 67 // Implementation of AudioInputStream. |
| 68 virtual bool Open() OVERRIDE; | 68 virtual bool Open() override; |
| 69 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 69 virtual void Start(AudioInputCallback* callback) override; |
| 70 virtual void Stop() OVERRIDE; | 70 virtual void Stop() override; |
| 71 virtual void Close() OVERRIDE; | 71 virtual void Close() override; |
| 72 virtual double GetMaxVolume() OVERRIDE; | 72 virtual double GetMaxVolume() override; |
| 73 virtual void SetVolume(double volume) OVERRIDE; | 73 virtual void SetVolume(double volume) override; |
| 74 virtual double GetVolume() OVERRIDE; | 74 virtual double GetVolume() override; |
| 75 | 75 |
| 76 // Returns the current hardware sample rate for the default input device. | 76 // Returns the current hardware sample rate for the default input device. |
| 77 MEDIA_EXPORT static int HardwareSampleRate(); | 77 MEDIA_EXPORT static int HardwareSampleRate(); |
| 78 | 78 |
| 79 bool started() const { return started_; } | 79 bool started() const { return started_; } |
| 80 AudioUnit audio_unit() { return audio_unit_; } | 80 AudioUnit audio_unit() { return audio_unit_; } |
| 81 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } | 81 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 // AudioOutputUnit callback. | 84 // AudioOutputUnit callback. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 // Used to defer Start() to workaround http://crbug.com/160920. | 154 // Used to defer Start() to workaround http://crbug.com/160920. |
| 155 base::CancelableClosure deferred_start_cb_; | 155 base::CancelableClosure deferred_start_cb_; |
| 156 | 156 |
| 157 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 157 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| 158 }; | 158 }; |
| 159 | 159 |
| 160 } // namespace media | 160 } // namespace media |
| 161 | 161 |
| 162 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 162 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| OLD | NEW |