OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 notes: | 5 // Implementation notes: |
6 // | 6 // |
7 // - It is recommended to first acquire the native sample rate of the default | 7 // - It is recommended to first acquire the native sample rate of the default |
8 // output device and then use the same rate when creating this object. | 8 // output device and then use the same rate when creating this object. |
9 // Use AudioManagerMac::HardwareSampleRate() to retrieve the sample rate. | 9 // Use AudioManagerMac::HardwareSampleRate() to retrieve the sample rate. |
10 // - Calling Close() also leads to self destruction. | 10 // - Calling Close() also leads to self destruction. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // |device| is the CoreAudio device to use for the stream. | 55 // |device| is the CoreAudio device to use for the stream. |
56 // It will often be the default output device. | 56 // It will often be the default output device. |
57 AUHALStream(AudioManagerMac* manager, | 57 AUHALStream(AudioManagerMac* manager, |
58 const AudioParameters& params, | 58 const AudioParameters& params, |
59 AudioDeviceID device); | 59 AudioDeviceID device); |
60 // The dtor is typically called by the AudioManager only and it is usually | 60 // The dtor is typically called by the AudioManager only and it is usually |
61 // triggered by calling AudioOutputStream::Close(). | 61 // triggered by calling AudioOutputStream::Close(). |
62 virtual ~AUHALStream(); | 62 virtual ~AUHALStream(); |
63 | 63 |
64 // Implementation of AudioOutputStream. | 64 // Implementation of AudioOutputStream. |
65 virtual bool Open() OVERRIDE; | 65 virtual bool Open() override; |
66 virtual void Close() OVERRIDE; | 66 virtual void Close() override; |
67 virtual void Start(AudioSourceCallback* callback) OVERRIDE; | 67 virtual void Start(AudioSourceCallback* callback) override; |
68 virtual void Stop() OVERRIDE; | 68 virtual void Stop() override; |
69 virtual void SetVolume(double volume) OVERRIDE; | 69 virtual void SetVolume(double volume) override; |
70 virtual void GetVolume(double* volume) OVERRIDE; | 70 virtual void GetVolume(double* volume) override; |
71 | 71 |
72 private: | 72 private: |
73 // AUHAL callback. | 73 // AUHAL callback. |
74 static OSStatus InputProc(void* user_data, | 74 static OSStatus InputProc(void* user_data, |
75 AudioUnitRenderActionFlags* flags, | 75 AudioUnitRenderActionFlags* flags, |
76 const AudioTimeStamp* time_stamp, | 76 const AudioTimeStamp* time_stamp, |
77 UInt32 bus_number, | 77 UInt32 bus_number, |
78 UInt32 number_of_frames, | 78 UInt32 number_of_frames, |
79 AudioBufferList* io_data); | 79 AudioBufferList* io_data); |
80 | 80 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 | 156 |
157 // Used to defer Start() to workaround http://crbug.com/160920. | 157 // Used to defer Start() to workaround http://crbug.com/160920. |
158 base::CancelableClosure deferred_start_cb_; | 158 base::CancelableClosure deferred_start_cb_; |
159 | 159 |
160 DISALLOW_COPY_AND_ASSIGN(AUHALStream); | 160 DISALLOW_COPY_AND_ASSIGN(AUHALStream); |
161 }; | 161 }; |
162 | 162 |
163 } // namespace media | 163 } // namespace media |
164 | 164 |
165 #endif // MEDIA_AUDIO_MAC_AUDIO_AUHAL_MAC_H_ | 165 #endif // MEDIA_AUDIO_MAC_AUDIO_AUHAL_MAC_H_ |
OLD | NEW |