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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 class AUAudioInputStream : public AgcAudioStream<AudioInputStream> { | 56 class AUAudioInputStream : public AgcAudioStream<AudioInputStream> { |
57 public: | 57 public: |
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 ~AUAudioInputStream() override; |
66 | 66 |
67 // Implementation of AudioInputStream. | 67 // Implementation of AudioInputStream. |
68 virtual bool Open() override; | 68 bool Open() override; |
69 virtual void Start(AudioInputCallback* callback) override; | 69 void Start(AudioInputCallback* callback) override; |
70 virtual void Stop() override; | 70 void Stop() override; |
71 virtual void Close() override; | 71 void Close() override; |
72 virtual double GetMaxVolume() override; | 72 double GetMaxVolume() override; |
73 virtual void SetVolume(double volume) override; | 73 void SetVolume(double volume) override; |
74 virtual double GetVolume() override; | 74 double GetVolume() override; |
75 virtual bool IsMuted() override; | 75 bool IsMuted() override; |
76 | 76 |
77 // Returns the current hardware sample rate for the default input device. | 77 // Returns the current hardware sample rate for the default input device. |
78 MEDIA_EXPORT static int HardwareSampleRate(); | 78 MEDIA_EXPORT static int HardwareSampleRate(); |
79 | 79 |
80 bool started() const { return started_; } | 80 bool started() const { return started_; } |
81 AudioUnit audio_unit() { return audio_unit_; } | 81 AudioUnit audio_unit() { return audio_unit_; } |
82 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } | 82 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } |
83 | 83 |
84 private: | 84 private: |
85 // AudioOutputUnit callback. | 85 // AudioOutputUnit callback. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 // Used to defer Start() to workaround http://crbug.com/160920. | 155 // Used to defer Start() to workaround http://crbug.com/160920. |
156 base::CancelableClosure deferred_start_cb_; | 156 base::CancelableClosure deferred_start_cb_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 158 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
159 }; | 159 }; |
160 | 160 |
161 } // namespace media | 161 } // namespace media |
162 | 162 |
163 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 163 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
OLD | NEW |