| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Implementation of AudioInputStream. | 59 // Implementation of AudioInputStream. |
| 60 virtual bool Open() OVERRIDE; | 60 virtual bool Open() OVERRIDE; |
| 61 virtual void Start(AudioInputCallback* callback) OVERRIDE; | 61 virtual void Start(AudioInputCallback* callback) OVERRIDE; |
| 62 virtual void Stop() OVERRIDE; | 62 virtual void Stop() OVERRIDE; |
| 63 virtual void Close() OVERRIDE; | 63 virtual void Close() OVERRIDE; |
| 64 virtual double GetMaxVolume() OVERRIDE; | 64 virtual double GetMaxVolume() OVERRIDE; |
| 65 virtual void SetVolume(double volume) OVERRIDE; | 65 virtual void SetVolume(double volume) OVERRIDE; |
| 66 virtual double GetVolume() OVERRIDE; | 66 virtual double GetVolume() OVERRIDE; |
| 67 | 67 |
| 68 // Returns the current hardware sample rate for the default input device. | 68 // Returns the current hardware sample rate for the default input device. |
| 69 MEDIA_EXPORT static double HardwareSampleRate(); | 69 MEDIA_EXPORT static int HardwareSampleRate(); |
| 70 | 70 |
| 71 bool started() const { return started_; } | 71 bool started() const { return started_; } |
| 72 AudioUnit audio_unit() { return audio_unit_; } | 72 AudioUnit audio_unit() { return audio_unit_; } |
| 73 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } | 73 AudioBufferList* audio_buffer_list() { return &audio_buffer_list_; } |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // AudioOutputUnit callback. | 76 // AudioOutputUnit callback. |
| 77 static OSStatus InputProc(void* user_data, | 77 static OSStatus InputProc(void* user_data, |
| 78 AudioUnitRenderActionFlags* flags, | 78 AudioUnitRenderActionFlags* flags, |
| 79 const AudioTimeStamp* time_stamp, | 79 const AudioTimeStamp* time_stamp, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 double hardware_latency_frames_; | 137 double hardware_latency_frames_; |
| 138 | 138 |
| 139 // The number of channels in each frame of audio data, which is used | 139 // The number of channels in each frame of audio data, which is used |
| 140 // when querying the volume of each channel. | 140 // when querying the volume of each channel. |
| 141 int number_of_channels_in_frame_; | 141 int number_of_channels_in_frame_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); | 143 DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ | 146 #endif // MEDIA_AUDIO_MAC_AUDIO_LOW_LATENCY_INPUT_MAC_H_ |
| OLD | NEW |